CholGen/Vibecheck 是一个托管在 GitHub 上的开源项目,主要使用 Jupyter Notebook 编写,采用 GNU General Public License v3.0 许可证,目前获得 9 个 Star、0 次 Fork。
仓库全名
CholGen/Vibecheck
README 摘要
This repository contains an easy-to-use program to assign O1 Vibrio cholerae genomes to canonical lineages using phylogenetic placement. Table of Contents 1. Introduction 2. How it Works 3. Installation 4. Updating 5. Usage 6. Output Introduction Genomic surveillance of cholera has identified at least three waves of global transmission from Asia to Africa during the seventh pandemic (7PET), and at least 17…
Genomic surveillance of cholera has identified at least three waves of global transmission from Asia to Africa during
the seventh pandemic (7PET), and at least 17 independent introductions of 7PET into Africa (deemed the T1-T17 lineages).
These lineages have been used to connect apparently disparate outbreaks, characterize regional transmission patterns,
and suggested possible transmission routes of cholera within Africa.
As well, genomic differences between lineages might explain differences in severity and transmissibility observed between different outbreaks.
Vibecheck enables the rapid assignment of sequences to these canonical lineages, as an alternative to a lengthy and
computationally intensive reconstruction of the global phylogeny.
How it works
[!NOTE]
The sequence-based classification performed by Vibecheck is basically a fork of Pangolin (and accompanying paper), in which the QC and hashing steps are removed, and an O1 Vibrio cholerae global phylogeny is used.
Therefore, we’d like to thank Áine O’Toole, Verity Hill, JT McCrone, Emily Scher and Andrew Rambaut for creating such a great and open-source tool.
Vibecheck is a tool that identifies which canonical O1 Vibrio cholerae lineage a sequence belongs to. It processes both:
Consensus genomes (fasta format)
De novo assemblies (fasta format)
Raw sequencing reads (fastq format) from Illumina or Oxford Nanopore (ONT) sequencers
The tool automatically selects the appropriate analysis workflow based on your input type.
Sequence-based classification
When provided with a multi-sequence fasta containing whole genome sequences, generated either by reference-based or de novo assembly,
Vibecheck:
Aligns sequences to a reference O1 V. cholerae genome using minimap2 and converts the mapping to a multi-sequence FASTA using gofasta.
Performs quality control by calculating the proportion of ambiguous characters in each sequence.
Sequences failing QC are excluded from lineage assignment
Identifies variants (SNPs) between each sequence and the reference, generating a VCF file using UCSC’s faToVcf.
Places sequences into a lineage-annotated phylogeny using UShER, and records whether the placement is contained within a lineage.
Analyzes UShER output to calculate lineage assignment confidence and generates a final report
Read-based classification
When provided with the raw sequencing data for a sample (a pair of fastq files for paired-end Illumina data, or a single fastq file for single-end Illumina or ONT data), Vibecheck:
Subsamples 20% of reads using seqtk to ease computational demands and speed-up the analysis.
Aligns reads to a reference O1 V. cholerae genome using minimap2, using the sr preset for Illumina reads or the map-ont preset for ONT reads.
Estimates lineage abundances from variant frequencies using Freyja.
Analyzes Freyja output to calculate confidence scores and generates a final report
Validation
Vibecheck achieves >98% accuracy in recapitulating lineages of sequences excluded from the guide tree.
For detailed validation of speed and accuracy, see the calculate_accuracy notebook.
For information on the empirical basis of our default maximum ambiguity parameter, see the ambiguity_thresholding notebook.
Installation
Install mamba by running the following two command:
These command should print the help and version of the program. Please create an issue if this is not the case.
Updating
Navigate to the directory where you cloned the vibecheck repository on the command line:
cd vibecheck/
Activate the vibecheck conda environment:
mamba activate vibecheck
Pull the latest changes from GitHub:
git pull
Update the vibecheck conda environment:
mamba env update -f environment.yaml
Reinstall the vibecheck command:
pip install .
Usage
Activate the vibecheck conda environment:
mamba activate vibecheck
Run
vibecheck [query ...]
Where [query ...] is the name of your input fasta file, a pair of fastq files, or a single fastq file.
A query fasta file can contain as many sequences as you would like to be classified, while fastq files should
only contain the data for one sample.
By default, Vibecheck assumes each sequence in a fasta file comes from a separate sample, if the sequences
instead represent contigs from a single de novo assembly, add --assemblies.
Vibecheck assumes fastq files were generated by an Illumina sequencer. To classify Oxford Nanopore (ONT) reads, supply a single fastq file and add --platform ont:
vibecheck --platform ont reads.fastq.gz
This command will generate a CSV file (lineage_report.csv) containing the estimated lineages for each sequence in the query file.
See Output for a complete description of this file.
[!ATTENTION]
Vibecheck is also available for use on Terra.
The sequence-based classification workflow is available here,
and the read-based classification workflow is available here
Full usage options
usage: vibecheck [-h] [-o OUTDIR] [--outfile OUTFILE] [--tempdir TEMPDIR] [--no-temp] [--lineage-aliases LINEAGE_ALIASES] [-t THREADS] [-v] [-u USHER_TREE] [-m MAX_AMBIGUITY] [--assemblies] [-b BARCODES] [--platform {illumina,ont}] [-s SUBSAMPLE] [--no-subsample] [query ...]
██╗ ██╗██╗██████╗ ███████╗ ██████╗██╗ ██╗███████╗ ██████╗██╗ ██╗
██║ ██║██║██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██║ ██╔╝
██║ ██║██║██████╔╝█████╗ ██║ ███████║█████╗ ██║ █████╔╝
╚██╗ ██╔╝██║██╔══██╗██╔══╝ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗
╚████╔╝ ██║██████╔╝███████╗╚██████╗██║ ██║███████╗╚██████╗██║ ██╗
╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝
Rapid classification of O1 Vibrio cholerae lineages.
positional arguments:
query Query sequences to classify
options:
-h, --help show this help message and exit
-o OUTDIR, --outdir OUTDIR
Output directory. Default: current working directory
--outfile OUTFILE Optional output file name. Default: lineage_report.csv
--tempdir TEMPDIR Specify where you want the temp stuff to go. Default: $TMPDIR
--no-temp Output all intermediate files, for dev purposes.
--lineage-aliases LINEAGE_ALIASES
Path to CSV file containing lineage aliases. File must have two columns: `alias` and `lineage`.
-t THREADS, --threads THREADS
Number of threads to use when possible. Default: all available cores, 4 detected on this machine
-v, --version Prints the version of Vibecheck and exits.
Sequence-based classification:
-u USHER_TREE, --usher-tree USHER_TREE
UShER Mutation Annotated Tree protobuf file to use instead of default tree
-m MAX_AMBIGUITY, --max-ambiguity MAX_AMBIGUITY
Maximum number of ambiguous bases a sequence can have before its filtered from the analysis. Default: 0.3
--assemblies Treat the input FASTA as a set of contigs from a single assembled sample, and produce one classification for the whole sample instead of one per sequence.
Read-based classification:
-b BARCODES, --barcodes BARCODES
Feather formatted lineage barcodes to use instead of default O1 barcodes
--platform {illumina,ont}
Sequencing platform used to generate the reads. Default: illumina
-s SUBSAMPLE, --subsample SUBSAMPLE
Fraction of reads to use in classification. Default: 0.2
--no-subsample Do not subsample reads. Default: False
Output
A successful run of Vibecheck will output a CSV file, named by default lineage_report.csv.
This output file contains 6 columns with a row for each sequence found in the query input file.
The sequence_id column contains the name of each provided sequence.
The qc_status column indicates whether a sequenced passed or failed quality control.
The qc_notes columns summarizes the results the quality control process.
The lineage column contains the most likely lineage assigned to a sequence.
The confidence column contains a value reflecting how confidence the assignment of a sequence is.
A value of 0 indicates, given the current phylogenetic tree, there is only a single lineage that the sequence could be assigned to, while a value above 0 indicates that number of lineages that a sequence could be assigned to.
The classification_notes column summarizes the placement(s) of a sequences.
[!NOTE]
The assignment of a sequence is sensitive to missing data at key sites, recombination, and other factors.
Therefore, caution should be taken in interpreting the results of Vibecheck.
All results should be confirmed with a complete phylogenetic reconstruction involving quality and completeness filtering, and recombination masking.
We recommend the bacpage phylogeny (available on Terra as well) pipeline for this.
Example output
sequence_id
qc_status
qc_notes
lineage
confidence
usher_note
SequenceA
pass
Ambiguous_content:0.01%
T13
1.0
Usher placements: T13(1/1)
SequenceB
pass
Ambiguous_content:0.03%
T15
1.0
Usher placements: T15(1/1)
SequenceC
pass
Ambiguous_content:0.02%
T12
1.0
Usher placements: T12(8/8)
SequenceD
pass
Ambiguous_content:0.13%
T13
0.6666
Usher placements: T13(2/3) UNDEFINED(1/3)
In the example above, SequenceA and SequenceB each have a single parsimonious placement in the phylogeny and are therefore assigned T13 and T15, respectively, with a confidence value of 1 indicating low uncertainty.
SequenceC has eight parsimonious placements in the phylogeny (as indicated by the (8/8) in the classification_notes column).
However, all of these placements are in the T12 lineage. Therefore, SequenceC is assigned the lineage T12 with a confidence value of 1 indicating high certainty.
SequenceD has three parsimonious placements in the phylogeny, two of which fall in the T13 lineage, and one which falls into non-African diversity.
SequenceD is therefore assigned as T13 because it is the most frequent assignment, but it has a confidence value less than 1 indicating an uncertain assignment.
The quality and completeness of this sequence should be confirmed, and a complete phylogenetic construction should be completed to confirm the lineage assignment.
评论