Skip to main content

A python tool used to automatically genotype rhinovirus.

Project description

rhinotype

rhinotype: A Python Package for the Classification of Rhinoviruses

Table of contents

  1. Background
  2. Workflow
  3. Installation
  4. getprototypeseqs
  5. readfasta
  6. SNPeek
  7. assign_types
  8. pairwise_distances
  9. overall_mean_distance
  10. count_SNPs
  11. plot_frequency
  12. plot_distances
  13. plot_tree
  14. plot_AA
  15. Citation
  16. Contributors

Background

Among the major causes of human respiratory infections, rhinovirus causes around 50% of all the year-round cases of common cold. This virus belongs to the Enterovirus genus in the Picornaviridae family. RV-A, RV-B, and RV-C are the three species under the genus Rhinovirus, each having about 169 different genotypes. Rhinoviruses are positive-sense, non-enveloped RNA viruses with approximately 7.2 kilobases long genome. The genome codes for seven non-structural proteins and four structural proteins—VP1, VP2, VP3, and VP4—which are part of the genome encoding viral replication and host infection mechanisms. Genotyping of Rhinovirus, until now, is done manually, while an R software package, rhinotypeR, allows for fully automated genotyping based on the VP4 region. The Python rhinovirus type package brings out VP1 and VP4 regions that aim to improve acuity in genotyping. The VP1 region has been tested to display better acuity in genotypic identification, while the VP4/2 region ensures compatibility under one universal amplification protocol for rapid genotyping.

Workflow

Workflow

Installation

You can install the package using the following command:

pip install rhinotype

Note: This package requires MAFFT for sequence alignment. Please ensure that you have MAFFT installed and that it is available in your system's PATH.

Run the package

rhinotype --mode {demo,user} --region {Vp1,Vp4/2} --threshold {VALUE} [--input FILE] [--model MODEL] --threads {VALUE}

getprotypeseqs

Gets the prototype sequences of the Rhinovirus genotypes and save the reference fasta file into RVRefs directory. Making both VP1 and VP4/2 sequences available depending on whch region you have. The tool then combines user sequences together with the prototype sequences and align them using MAFFT or any other alignment tool.

readfasta

Reads the alignments/sequences. Compares the input sequences and pads the short sequences with - until they are long as the longest sequence. The sequences are then stored in a dictionary with the sequence name as the key and the sequence as the value.

SNPeek

SNPeek function visualizes single nuclotide polymorphisms(SNPs) using the users sequences, relative to a specified reference sequence. To specify a reference sequence, the user should move the sequence to the bottom of the alignment. Substitutions are color coded by nucleotide: A = green, T = red, C = blue, G = yellow.

assign_types

The assign_types function assigns genotype to the sequences in the fasta file by comparing them to the prototype sequences. The classification is based on pairwise distances calculated using a specified distance model. Users can adjust parameters for gap deletion and threshold to control the classification process. The function reads prototype sequences from predefined CSV files based on the specified prototype type.

Parameters:

  • fasta_data (DataFrame): A DataFrame containing the sequences to be classified.
  • model (str): The distance model to use (default is 'p-distance').
  • gap_deletion (bool): Whether to apply gap deletion in distance calculations (default is True).
  • threshold (float): The distance threshold for classification (default is 0.105)

pairwise_distances

Calculates pairwise genetic distances between sequences in a FASTA dataset using the specified distance model. The function supports various models for distance calculation and can optionally apply gap deletion. The result is a DataFrame showing the distances between each pair of sequences.

Parameters:

  • fasta_data (DataFrame): A DataFrame containing the sequences to be analyzed.
  • model (str): The distance model to use. Options include:
    • "p-distance": Simple proportion of differing sites.
    • "JC": Jukes-Cantor model.
    • "Kimura2p": Kimura 2-parameter model.
    • "Tamura3p": Tamura 3-parameter model.
  • gap_deletion (bool): Whether to apply gap deletion in the distance calculation (default is True).
  • Output: The function returns a numpy array containing the pairwise distances between the sequences

overall_mean_distance

Calculates the overall mean genetic distance between sequences using various distance models. The function supports multiple models and can optionally handle gap deletion in sequences. It provides an average distance value based on the chosen model.

count_SNPs

Counts the single nucleotide polymorphisms (SNPs) in the provided sequence data and can optionally handle gap deletion in the sequences.

plot_frequency

Generates a bar chart visualizing the frequency of assigned types from a DataFrame. The function creates a bar chart where each bar represents the count of a specific type, and colors are used to differentiate between species. The chart is saved as an image file and can optionally include a legend.

plot_distances

Generates a heatmap to visualize the pairwise genetic distances between sequences and saves the plot as an image file. The color scale represents the magnitude of genetic distances.

plot_tree

Generates a hierarchical clustering dendrogram from the pairwise genetic distances between sequences. The function performs complete linkage clustering and visualizes the results as a tree diagram. The dendrogram is saved as an image file.

plot_AA

Visualizes amino acid differences between protein sequences. The function compares each sequence to a reference sequence and plots the differences as colored bars, categorizing amino acids based on their properties. The plot is saved as an image file.

Citation

Contributors

  1. Ephantus Wambui

  2. Daniel Okoro

  3. Andrew Acheampong

  4. Parcelli Jepchirchir

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

rhinotype-1.0.0.tar.gz (213.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rhinotype-1.0.0-py3-none-any.whl (229.4 kB view details)

Uploaded Python 3

File details

Details for the file rhinotype-1.0.0.tar.gz.

File metadata

  • Download URL: rhinotype-1.0.0.tar.gz
  • Upload date:
  • Size: 213.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for rhinotype-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f50e8f79e2a0f674440a7015e8ab59cf0a2ef68e7b776ec5baf632c4f16bc1cb
MD5 f9ea95cce7066d881c3726a5247536fd
BLAKE2b-256 54810f1e44a2d60e30e1d1fa5ed7de81635862b53978342430d8f29cce90b872

See more details on using hashes here.

File details

Details for the file rhinotype-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rhinotype-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 229.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for rhinotype-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec2fd9665f25c51d331ccecf000fd44baac4e95a7da8d327f0490976cbd4834d
MD5 faf2284c62f14a42119205e2b7630e28
BLAKE2b-256 2536cf9593de555d5b1821fef5b7098548244c48b8992878e74d7e3185f4344a

See more details on using hashes here.

Supported by

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