Skip to main content

A tool and package for quality control of consensus virus genomes.

Project description

Install

ViralQC is a tool and package for quality control of consensus virus genomes which uses the nextclade tool, BLAST and a series of internal logics to classify viral sequences and perform quality control of complete genomes, regions or target genes.

From pip

First, install the dependencies:

or with micromamba

micromamba install \
  -c conda-forge \
  -c bioconda \
  "python>=3.8.0,<3.12.0" \
  "snakemake-minimal>=7.32.0,<7.33.0" \
  "blast>=2.16.0,<2.17.0" \
  "nextclade>=3.15.0,<3.16.0" \
  "seqtk>=1.5.0,<1.6.0" \
  "ncbi-datasets-cli>=18.9.0,<18.10.0" \
  "taxonkit>=0.20.0,<0.21.0"

Then, install viralQC

pip install viralQC

From Source

git clone https://github.com/InstitutoTodosPelaSaude/viralQC.git
cd viralQC

Dependencies

micromamba env create -f env.yml
micromamba activate viralQC

viralQC

pip install .

Check installation (CLI)

vqc --help

Usage (CLI)

get-nextclade-datasets

This command configures local datasets using nextclade. It is necessary to run at least once to generate a local copy of the nextclade datasets, before running the run-from-fasta command

vqc get-nextclade-datasets --cores 2

A directory name can be specified, the default is datasets.

vqc get-nextclade-datasets --cores 2 --datasets-dir <directory_name>

get-blast-database

This command configures local blast database with all ncbi refseq viral genomes. It is necessary to run at least once to generate a local blast database, before running the run-from-fasta command.

vqc get-blast-database --cores 2

A output directory name can be specified, the default is datasets.

vqc get-blast-database --cores 2 --output-dir <directory_name>

run-from-fasta

This command runs several steps to identify viruses represented in the input FASTA file and executes Nextclade for each identified virus/dataset.

run-from-fasta

vqc run-from-fasta --sequences-fasta test_data/sequences.fasta

Some parameters can be specified:

  • --output-dir — Output directory name. Default: output
  • --output-file - File to write final results. Valid extensions: .csv, .tsv or .json. Default: results.tsv
  • --datasets-dir — Path to the local Nextclade datasets directory. Default: datasets
  • --ns-min-score — Minimum score used by the Nextclade sort command. Default: 0.1
  • --ns-min-hits — Minimum number of hits for Nextclade to consider a dataset. Default: 10
  • --blast-database - Path to store local blast database. Default: datasets/blast.fasta
  • --identity-threshold - Percentual identity threshold for BLAST analysis. Default: 0.9
  • --cores — Number of threads used in nextclade sort and nextclade run. Default: 1

The output directory has the following structure:

├── <datasets>                    # Output from nextclade sort; sequences for each dataset split into sequences.fa files.
├── datasets_selected.tsv         # Formatted nextclade sort output showing the mapping between input sequences and local datasets.
├── <virus/dataset>.nextclade.tsv # Nextclade run output for each identified virus, including clade assignments and QC metrics.
├── unmapped_sequences.txt        # Names of input sequences that were not mapped to any virus on nextclade sort.
├── unmapped_sequences.blast.tsv  # BLAST results for unmapped sequences.
├── unmapped_sequences.blast.tsv  # BLAST results for unmapped sequences.
├── viruses.external_datasets.tsv # Nextclade sort output showing the mapping between input sequences and external (outside nextclade_data) datasets. 
└── viruses.tsv                   # Nextclade sort output showing the mapping between input sequences and remote (nextclade_data) datasets.

Usage (API)

vqc-server

Go to http://127.0.0.1:8000/docs

Development

Install development dependencies and run black into viralqc directory.

pip install -e ".[dev]"
black viralqc

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

viralqc-0.9.1.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

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

viralqc-0.9.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file viralqc-0.9.1.tar.gz.

File metadata

  • Download URL: viralqc-0.9.1.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for viralqc-0.9.1.tar.gz
Algorithm Hash digest
SHA256 3708f2a5f045157cc37018128cc9a3bd4f24d5670887d681470e99001059d42f
MD5 47783d5994ebc916881cfdb697728c7b
BLAKE2b-256 41e58a5736487e5e68d00ade76fa3d66c177bcd3674a9dd2b3914f32ef65ea9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for viralqc-0.9.1.tar.gz:

Publisher: publish-to-pypi.yml on InstitutoTodosPelaSaude/viralQC

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file viralqc-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: viralqc-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for viralqc-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb929bf795412a6e6d74c4fff8b1453185126041f74c09035a716c96f117e1e2
MD5 99c5c15e3eca29d8b5dde9ea1780fade
BLAKE2b-256 6e2da1a61dda29df94c058cd4ef60a26a2a229d1c30da22c21b49f3f62504da8

See more details on using hashes here.

Provenance

The following attestation bundles were made for viralqc-0.9.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on InstitutoTodosPelaSaude/viralQC

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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