Skip to main content
  _______ _______      _______ ______
 |__   __|  __ \ \    / /_   _|___  /
    | |  | |__) \ \  / /  | |    / /
    | |  |  _  / \ \/ /   | |   / /
    | |  | | \ \  \  /   _| |_ / /__
    |_|  |_|  \_\  \/   |_____/_____|

TRviz is a python library for analyzing tandem repeat sequences. TRviz includes modules for decomposing, encoding, aligning, and visualizing tandem repeat sequences.

Documentation

Quick Start

Prerequisites

  • Python 3.10+ (3.10, 3.11, or 3.12 are tested)
  • MAFFT (for multiple sequence alignment) — install from MAFFT website. Tested with v7.505.

Install

pip install trviz

Or from source:

git clone https://github.com/Jong-hun-Park/trviz.git
cd trviz/
pip install .

Run your first analysis

Check out our Jupyter notebook for code examples.

Features Overview

Input and output

Input

  1. Tandem repeat sequences (alleles)
  2. A set of motifs for decomposition

Output

  1. A plot showing the motif composition of the input sequences (PDF by default)
  2. A plot mapping color to motif (PDF by default)
  3. Aligned and labeled motifs (text file)
  4. Motif map: a set of motifs detected in the samples and their labels and frequencies (text file)

For more detailed descriptions, see the full documentation at readthedocs.

Code examples

Generate a plot (saves to disk)

from trviz.main import TandemRepeatVizWorker
from trviz.utils import get_sample_and_sequence_from_fasta

tr_visualizer = TandemRepeatVizWorker()
sample_ids, tr_sequences = get_sample_and_sequence_from_fasta(fasta_file_path)
tr_id = "CACNA1C"
motifs = ['GACCCTGACCTGACTAGTTTACAATCACAC']

tr_visualizer.generate_trplot(tr_id, sample_ids, tr_sequences, motifs)

Customize the plot via matplotlib (v1.4.0+)

generate_trplot() and the underlying trplot() / plot_motif_color_map() now return (fig, ax), so you can apply any matplotlib styling — fonts, ticks, titles, layout — before saving the figure yourself.

fig, ax = tr_visualizer.generate_trplot(
    tr_id, sample_ids, tr_sequences, motifs,
    save=False,                       # skip the built-in savefig
)

# Apply any matplotlib styling you want:
ax.set_title("CACNA1C VNTR composition", fontsize=14)
ax.tick_params(axis="x", labelsize=12)
ax.set_xlabel("Repeat unit", fontsize=12)

fig.savefig("CACNA1C.pdf", dpi=300, bbox_inches="tight")

You can also draw the plot into your own ax (useful for embedding in a multi-panel figure):

import matplotlib.pyplot as plt

fig, axes = plt.subplots(1, 2, figsize=(16, 6))
tr_visualizer.visualizer.trplot(
    aligned_labeled_repeats=aligned_trs,
    sample_ids=sorted_sample_ids,
    symbol_to_motif=symbol_to_motif,
    ax=axes[0],                       # draw into your own axes
    sort_by_clustering=False,
)
# ... draw something else into axes[1] ...
fig.savefig("multi_panel.pdf")

Motif decomposition

from trviz.decomposer import Decomposer

tr_decomposer = Decomposer()
tr_sequence = "ACCTTGACCTTGACCTTGACCTTG"
motifs = ["ACCTTG"]
tr_decomposer.decompose(tr_sequence, motifs)
# >>> ["ACCTTG", "ACCTTG", "ACCTTG", "ACCTTG"]

Citation

Jonghun Park, Eli Kaufman, Paul N Valdmanis, Vineet Bafna, TRviz: a Python library for decomposing and visualizing tandem repeat sequences, Bioinformatics Advances, Volume 3, Issue 1, 2023, vbad058.

Contribute

Your feedback is valuable! If you encounter any issues during installation or usage, please submit them in the TRviz GitHub Issues.

Metadata

Release files for trviz 1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trviz 1.4.2
File Size Uploaded
trviz-1.4.2.tar.gz 796.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for trviz 1.4.2
File
trviz-1.4.2-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details
trviz-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
trviz-1.4.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
trviz-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details
trviz-1.4.2-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details
trviz-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
trviz-1.4.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
trviz-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
trviz-1.4.2-cp310-cp310-musllinux_1_2_x86_64.whl CPython 3.10 CPython 3.10 Linux musl 1.2+ x86-64 Details
trviz-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
trviz-1.4.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
trviz-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details

Total release size: 4.2 MB

Release files / trviz-1.4.2.tar.gz

Download URL trviz-1.4.2.tar.gz
Size 796.0 kB
Tags Source
SHA-256 checksum
How to use checksums
892907b776b3c88316313f29f6bd75e75eba2af1c63b60b68d5ccdbc44c758ca
BLAKE2b-256 checksum
How to use checksums
87274f2741601774932a31fd253bdd9287fd7e17f1a13b983fe8e2eb40ccaf0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL trviz-1.4.2-cp312-cp312-musllinux_1_2_x86_64.whl
Size 390.9 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
ada7654e44621141a692af989707e26e6af337c9f7bb264dc78be109c9667fca
BLAKE2b-256 checksum
How to use checksums
a06af638088232db736cf0baa8968c144918c98531859e382ed1c2df66df3a59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL trviz-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 391.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2f00e9ef9e01f98121f09a0285f966a42ae9d10b2a7e8cc7c09c7bf12bcb3b83
BLAKE2b-256 checksum
How to use checksums
f17affb89adddd9659594caef2dad55f4600730fa141f1b4165e175871a16e08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL trviz-1.4.2-cp312-cp312-macosx_11_0_arm64.whl
Size 187.8 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4aab8a72c15c12e0d1b23f6fbbd8b455cef89ac77c4c3c7f9c67998df2297dc5
BLAKE2b-256 checksum
How to use checksums
a03d736db1fc09b91fd9d7437c8a47f4ce1216a0625ba0f1a9e59f3914e4ff74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl

Download URL trviz-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl
Size 188.9 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
f27e33041b602bf563c41a4d97bafefc2eaa7e7bd2bc700e1c0bd07ff18388ea
BLAKE2b-256 checksum
How to use checksums
ff0357eecf678759cb6b050f8d88dc565bd9c662ac96dab24acd89074be917cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL trviz-1.4.2-cp311-cp311-musllinux_1_2_x86_64.whl
Size 386.4 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
ac9d3cfee00bd1c1d65ea92444e4801d2aab43c4ca751ccf7200dd111e37d634
BLAKE2b-256 checksum
How to use checksums
210ae97a356468f1e57e5e52bfc9c700339568306df5b70fa40adaf101a26a20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL trviz-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 382.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1967600f46fa130c4034c79e522db43057375923e392ae4aca5fed120e29677b
BLAKE2b-256 checksum
How to use checksums
f69cd10b0bad721fe148ff96c55b5528c2933d62068c6fcfd2351db011255466
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL trviz-1.4.2-cp311-cp311-macosx_11_0_arm64.whl
Size 188.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e0421d68b57ea55209ea194cb891c96da4973ed265b4487b38dad3f55721d5eb
BLAKE2b-256 checksum
How to use checksums
704bd343bc9f492a30ddc95f011181e735f1a65d43ecd2df890c35880bd10298
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl

Download URL trviz-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl
Size 189.1 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
73c93a0f2b549f357a13d33c09f8c3f2fd3a1a03c4b836f37dfe2ffca80fb5f9
BLAKE2b-256 checksum
How to use checksums
060528cd96ed4f238c202a361d10a54f5be0ceeff465f1b2ab0ff8fe7c60f9ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp310-cp310-musllinux_1_2_x86_64.whl

Download URL trviz-1.4.2-cp310-cp310-musllinux_1_2_x86_64.whl
Size 370.7 kB
Tags CPython 3.10 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
0fd1c68972c4f0138bea25f3a34bee0aa8266839c86ee965965b306d3aa9e1ae
BLAKE2b-256 checksum
How to use checksums
6827ac907153227808f7bfedbbbb6e3fad796c590adac2d1690f2c0c91a22c36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL trviz-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 367.9 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9caae05238763f06b468fe4ddfb22af175f3534e7d3515d333520c7ea8130e56
BLAKE2b-256 checksum
How to use checksums
3d2173e249897979bd5ad67fdcc5c3de285cb82ea963f2b7ddfc3372b9cadf40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL trviz-1.4.2-cp310-cp310-macosx_11_0_arm64.whl
Size 189.0 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
87ea8bb1e04d4eefc163005c31c715020adc9abf38f021cff02c1582016a5564
BLAKE2b-256 checksum
How to use checksums
eb1e4504b5271e93601566cd10c4b6adbef14d3f9641ea94446f3ee4e66c8347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / trviz-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl

Download URL trviz-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl
Size 189.4 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
709acaebc66035dd74cc1d49e229fa9afd35ee9a961778272b9c449e30c933cb
BLAKE2b-256 checksum
How to use checksums
c706a5828b68e1665488312022666c1ad684b48dcdfc10c28eb16d7c32152da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.4.2 This release

13 release files

1.4.1

13 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page