Skip to main content

A python library for decomposing and visualizing tandem repeat sequences

Project description

  _______ _______      _______ ______
 |__   __|  __ \ \    / /_   _|___  /
    | |  | |__) \ \  / /  | |    / / 
    | |  |  _  / \ \/ /   | |   / /  
    | |  | | \ \  \  /   _| |_ / /__ 
    |_|  |_|  \_\  \/   |_____/_____|

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

Full documentation is available at readthedocs

Overview of TRviz

Getting Started

Prerequisite

Note TRviz requires MAFFT. Tested with MAFFT v7.505.

Install the library with pip or from source.

with pip

pip install trviz

from source

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

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
  2. A plot mapping color to motif
  3. Aligned and labeled motifs
  4. Motif map, a set of motifs detected in the samples and their labels and frequencies

Code samples and examples

Note Please see the jupyter notebook for code examples.

TRviz has four modules:

  1. Decomposition
  2. Encoding
  3. Alignment
  4. Visualization

See full documentation at readthedocs

Generating a plot

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)

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

Contact Us

Please submit an issue on the TRviz github

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trviz-1.2.0.tar.gz (2.1 MB view hashes)

Uploaded Source

Built Distribution

trviz-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (395.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page