Skip to main content

CLI toolkit for building distance-based proteomic virus phylogenies from protein or nucleotide inputs

Project description

virusdicer logo


VirusDicer is a command-line toolkit for building distance-based proteomic virus phylogenies from protein or nucleotide inputs.

Workflow

Show workflow chart
flowchart TD
    input[Input sequences or table] --> mode{Input type}
    mode -->|--in-fna| orfs[Predict ORFs with pyrodigal-gv]
    mode -->|--in-faa| faa[Prepare protein FASTA]
    mode -->|--in-dmnd-tab| dmnd[DIAMOND output table]
    orfs --> faa
    faa --> blast[DIAMOND makedb + blastp]
    blast --> dmnd
    dmnd --> filter[Filter DIAMOND hits]
    filter --> best[Best hit per query protein and target genome]
    best --> score[Symmetric genome bitscore matrix]
    score --> dice[Dice distance matrix]
    dice --> support{Support replicates?}
    support -->|yes| reps[Bootstrap or jackknife replicates]
    reps --> tree[BioNJ tree with midpoint rooting]
    support -->|no| tree
    tree --> final[Final Newick tree]

Dice distance:

$$ D_{AB} = 1 - \frac{2AB}{AA + BB} $$

where AB is the symmetric bitscore between genomes A and B, and AA and BB are their self bitscores.

Installation

External dependencies:

  • DIAMOND (tested with v2.1.24)
  • R (tested with v4.5.3)
  • R package ape (tested with v5.8.1)

If you have all the external dependencies:

python3 -m venv venv
source venv/bin/activate
pip install virusdicer

Conda:

conda env create --file https://raw.githubusercontent.com/dbespiatykh/VirusDicer/refs/heads/main/environment.yml
conda activate virusdicer
virusdicer -h

Usage

Usage: virusdicer [OPTIONS]

  `VirusDicer` builds a distance-based proteomic virus phylogeny.

  Examples:
    virusdicer --in-fna genomes/ -o virusdicer_out
    virusdicer --in-dmnd-tab hits.tsv -o virusdicer_out

  Provide either FAA/FNA inputs for a full end-to-end run, or a correctly
  formatted all-vs-all DIAMOND outfmt6 table with self hits and columns:
  qseqid sseqid pident length qlen slen evalue bitscore

Options:
  --in-faa TEXT                   Protein FAA inputs. Provide one or more files or directories. Provide one or more
                                  values after the option name.  [default: all_proteins.faa]
  --in-fna TEXT                   Nucleotide FASTA inputs used for ORF calling. Provide one or more files or
                                  directories. Provide one or more values after the option name.
  --in-dmnd-tab TEXT              Use an existing DIAMOND outfmt6 table instead of running DIAMOND.
  -o, --output-dir TEXT           Write pipeline outputs to this directory.  [default: virusdicer_out]
  -t, --threads INTEGER           Total worker budget for pyrodigal-gv ORF prediction, DIAMOND, and support
                                  replicate computation.  [default: 4]
  --diamond-sensitivity INTEGER   DIAMOND search sensitivity level.
                                  
                                  1 default
                                  2 fast
                                  3 mid-sensitive
                                  4 sensitive
                                  5 more-sensitive
                                  6 very-sensitive (default)
                                  7 ultra-sensitive
  --min-pident FLOAT              Minimum percent identity retained from DIAMOND hits.  [default: 30.0]
  --min-aalen FLOAT               Minimum alignment length in amino acids retained from DIAMOND hits.  [default:
                                  30.0]
  --max-evalue FLOAT              Maximum e-value retained from DIAMOND hits.  [default: 0.01]
  --min-bitscore FLOAT            Minimum bitscore retained from DIAMOND hits.  [default: 30.0]
  --min-qcov FLOAT                Minimum query coverage retained from DIAMOND hits. Accepts values like 50 or 0.5.
                                  [default: 0.5]
  --min-scov FLOAT                Minimum subject coverage retained from DIAMOND hits. Accepts values like 50 or
                                  0.5.  [default: 0.5]
  --min-protein-len INTEGER       Exclude hits where either protein is shorter than this.  [default: 50]
  --id-regex TEXT                 Regex with one capture group used to derive genome IDs from protein IDs.  [default:
                                  ^(.*)_\d+$]
  --write-score-matrix            Write the symmetric genome-vs-genome bitscore matrix.
  --support-mode [bootstrap|jackknife]
                                  Resampling strategy used when --support-replicates is greater than zero.  [default:
                                  bootstrap]
  --support-replicates INTEGER    Number of protein-level support replicates to compute for branch support.  [default:
                                  0]
  --jackknife-fraction FLOAT      Fraction of proteins to keep per genome in each jackknife replicate.  [default: 0.5]
  --support-seed INTEGER          Random seed for bootstrap or jackknife replicate generation.  [default: 1984]
  -v, --version                   Show the version and exit.
  -h, --help                      Show this message and exit.

From nucleotide FASTAs:

virusdicer --in-fna genomes/ -o virusdicer_out

From protein FASTAs:

virusdicer --in-faa faa/ -o virusdicer_out

From a DIAMOND output table:

diamond blastp \
  --query faa \
  --db db \
  --out diamond_output.tsv \
  --outfmt 6 qseqid sseqid pident length qlen slen evalue bitscore \
  --max-target-seqs 0 \
  --evalue 1000.0 \
  --more-sensitive


virusdicer --in-dmnd-tab diamond_output.tsv -o virusdicer_out

With bootstrap support:

virusdicer --in-fna genomes/ -o virusdicer_out \
  --support-replicates 1000 \
  --support-mode bootstrap

Main output

  • virusdicer_out/dice_distance.tsv - Distance matrix
  • virusdicer_out/genome_bitscore.tsv when --write-score-matrix is used - Score matrix
  • virusdicer_out/bionj.nwk - BioNJ phylogeny

Citation

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

virusdicer-0.1.1.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

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

virusdicer-0.1.1-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file virusdicer-0.1.1.tar.gz.

File metadata

  • Download URL: virusdicer-0.1.1.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for virusdicer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55adc88a078a7e6e130df066f61b729806a558fc15a46c1b90e835c03fc178c7
MD5 9d44ead1748a1f12d45db200463b723c
BLAKE2b-256 b9c01da35213dca42aaa8865c138633b1f357cea996aed421b1ed70446d6f0b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for virusdicer-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on dbespiatykh/VirusDicer

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

File details

Details for the file virusdicer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: virusdicer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for virusdicer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eee9d505e7efeaab1bb4c8d3127e37b345dac34070514335badb76cb3e904047
MD5 1e00902f3e37e8328b9eea98a15e63fb
BLAKE2b-256 15ab6d2a2f0002e6e1e04d161302a90ea4e3fef346147c0ed9b87df57c53e06b

See more details on using hashes here.

Provenance

The following attestation bundles were made for virusdicer-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on dbespiatykh/VirusDicer

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