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

  5. Olaitan I. Awe

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-2.0.0.tar.gz (215.8 kB view details)

Uploaded Source

Built Distribution

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

rhinotype-2.0.0-py3-none-any.whl (231.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rhinotype-2.0.0.tar.gz
Algorithm Hash digest
SHA256 26f29cd0bd82153a4d3df95ab41dc073de7247f2c1c7ab78ea6a4e198329408e
MD5 e96fc0dd43dc15247742dc3d5646fdfb
BLAKE2b-256 719534263fb01c444a776db69b1333bda2cd7427bd7e0755f4c10663518e05dd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rhinotype-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4492007405a28eb98798dbd258d0b2627592170a0e65da172e4b48d3279bd61f
MD5 dd66bd1585cd26016f93376e7a271a3e
BLAKE2b-256 8ee4482a0fbb37b012216e7c332098b637352ecce5a2e6f1682487b7793a27ee

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