A Python visualization tool for genomic surveillance
Project description
VARGRAM (Visual ARrays for GRaphical Analysis of Mutations)
🧬 VARGRAM is a Python package that makes it easy to generate insightful figures for genomic surveillance, born out of our experience during the COVID-19 pandemic. With the latest update, VARGRAM can be used to generate mutation profiles straight from sequence files by hooking into existing tools such as Nextclade. The figures can be easily customized within a Python script or Jupyter notebook using a declarative syntax.
🔥 We are actively developing VARGRAM into a full visualization library for common use cases in molecular epidemiology. More modules will be added in the coming months. If you have a feature request or find a bug, please submit an issue.
Installation
A pre-release (but tested) version of VARGRAM is available for download and can already be used. To install with pip, run
pip install --pre vargram
on the command line. Python version ≥3.11 is required.
VARGRAM relies on Nextclade to perform mutation calling when sequence files are provided. Make sure to download the Nextclade CLI and add it to the path. (Alternatively, you may provide Nextclade's analysis CSV output directly and VARGRAM can still produce a mutation profile without Nextclade installed.)
Full installation instructions are available on the VARGRAM Wiki.
Quickstart Guide
To produce a mutation profile, VARGRAM requires a single FASTA file (or a directory of FASTA files) of samples, a FASTA file for the reference, and a genome annotation file following the GFF3 format.
A mutation profile can be generated in just four lines of code:
from vargram import vargram # Importing the package
vg = vargram(seq='path/to/covid_samples/', # Provide sample sequences
ref='path/to/covid_reference.fa', # Provide reference sequence
gene='path/to/covid_annotation.gff') # Provide genome annotation
vg.profile() # Tell VARGRAM you want to create a mutation profile
vg.show() # And show the resulting figure
Alternatively, you can simply provide a CSV file. For example, you can upload your sequences to the Nextclade web app and download the analysis CSV output. VARGRAM recognizes this output and can process it:
from vargram import vargram
vg = vargram(data='path/to/nextclade_analysis.csv')
vg.profile()
vg.show()
Calling the mutation profile this way does not require Nextclade CLI to be installed.
Sample Output
Check out the VARGRAM Wiki for more details, including how to customize the figure and produce profiles like the following:
Note that by default, VARGRAM favors placing genes with the most number of mutations first. Thus, the S gene above is shown at the very top, even though the start position of ORF1a is smaller. You may wish to force VARGRAM to show the genes in order based on the start position. You can do so by setting vargram(order=True)
. The mutation profile above will then look like the following:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file vargram-0.2.0b1.tar.gz
.
File metadata
- Download URL: vargram-0.2.0b1.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b194c611704a1819239c67fe800a75a1cddd401ab50f3a0d71b65b357b0de9d6 |
|
MD5 | 64763a039c86b841f0479ae44000792e |
|
BLAKE2b-256 | 61ebb4bbf7d4c47b9fb2409f2cb504aaf5272508402812f59fc0c05dabcc0ca0 |
File details
Details for the file vargram-0.2.0b1-py3-none-any.whl
.
File metadata
- Download URL: vargram-0.2.0b1-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1ec21874eefc707623d779d6e3f447a93f2cec496e2076d3e307867b06e968c |
|
MD5 | b7783c1ec9561a7375e50cf41fd7c65a |
|
BLAKE2b-256 | 23c3c557132f13b62f5b2c23fc28c764e44531d7610fff698771f06dfda5bf6e |