Next V-Power is a tool for multi-virus lineage demixing from amplicon sequencing data, for wastewater and other mixed samples.
Important
(Updated on 2025/12/23) A new version of NextVpower is developed for analyzing universal species of pathogens. It has been validated on Norovirus and Human Adenovirus for lineage demixing capability.
The new codes and resource will be released after publication.
Important
(Updated on 2025/6/25) Now we have generated barcode matrixes of multi-virus extracted from NextClade phylogenetic tree. To specify a barcode matrix, please use parameter -b to select a file.
Apart from demixing sars-cov-2 with usher_barcodes, you can try demixing other kind of viruses with our new barcode matrix, including IAV, IBV, hmpv, measles, mpox, rsv, dengue, prrsv1 and marburgvirus.
Parameters -n and -k may vary for different kind of viruses.
Our barcode extracter tool is available now (see BarcodeExtracter.py), then you can update barcode matrixes from NextClades source on time!
Note: Red numbers indicate adjustable parameters. Green numbers may change according to your sequencing data and the updating of the barcode matrix A.
- python3
- numpy
- pandas
- cvxpy
This tool was developed on Windows, and tested on Linux.
1.Clone this repository to your local directory.
2.Install requiments in a python environment. Skip if you have reached these requirments.
pip install numpy pandas cvxpy3.Change directory to where you cloned this repository to.
cd /path/of/NextVpower #example path4.Uncompress resource.tar.gz under current directory.
Output folder should contains usher_barcodes.csv, var_anno.csv, and other barcodes files like clade_barcodes_flu_h1n1pdm_ha_CY121680.csv.
tar -zxvf resource.tar.gz- For Windows, please uncompress the tar.gz file to the folder where they are current located.
5.Run python command to check installation and see help.
python NextVpower.py -hNote
usher_barcodes.csv was generated via Freyja and this file was copied from Freyja repository.
var_anno.csv was downloaded from NGDC: RCoV19 - Variation Annotation and we made some format convertion on it (Only for sars-cov-2 annotation).
Unlike Freyja, NextVpower takes into account INDEL-type mutations when processing input data, which may provide more accurate lineage demixing results. Also, NextVpower can detect the potential mutation sites of each sample.
Note
Vpower.m and Vpower2.m are MATLAB scripts of V-Power.
NextVpower.py is a standalone program, which has integrated the function of Vpower.m and Vpower2.m without using MATLAB engine.
- Demix from input sample mutation table file, and save result to result.tsv:
python NextVpower.py -i PP_raw_example.tsv -o demix_result_example.tsv- Demix from input *.vcf files under a folder, filter mutation sites with mutation rate lower than 0.1, filter mutation sites with depth lower than 10, and save result to result.tsv:
python NextVpower.py -i vcf_example -r 0.1 -d 10 -o demix_result_vcf_example.tsv- Set barcode filter criteria, filter lineages with fewer than 0.02 of total "key" mutation sites (default 0.01), retain "key" mutation sites present in more than 0.1 of total lineages (default 0.05):
python NextVpower.py -i PP_raw_example.tsv -n 0.02 -k 0.1 -o demix_result_example_300_30.tsv- Add annotation to sample mutation table according to variation annotation table and demix:
python NextVpower.py -i vcf_example -o demix_result_vcf_example.tsv --ann_vcsample Annotated_PP_raw_example.tsv- Demix from input *.vcf files under a folder, save result in result.tsv, and save middle data to files:
python NextVpower.py -i vcf_example -o demix_result_vcf_example.tsv --vcsample PP_raw_example.tsv --fbarcode MMFF_example.tsv --fsample PPFF_example.tsv --potentials potential_sites_example.tsvPlease see detailed usage by running python NextVpower.py -h or in source code
Tip
How to create VCF files?
-
1.Align sample.reads.fq to reference.fa by running
bwa mem,samtools sortandsamtools view, to generate sample.bam. -
2.Use variant calling tools (freebayes is recommended) to generate sample.vcf from sample.bam.
Here's an example of demixing using reads file:
bwa index reference.fa
samtools faidx reference.fa
bwa mem -t 4 reference.fa sample.reads.fq | samtools view -bS --threads 4 | samtools sort --threads 4 -o sample.bam
samtools index sample.bam
freebayes --haplotype-length 0 --pooled-continuous -m 20 -p 1 --strict-vcf -q 13 --min-coverage 10 -F 0.4 -f reference.fa sample.bam | \
bcftools annotate --remove ^INFO/TYPE,^INFO/DP,^INFO/RO,^INFO/AO,^INFO/AB,^FORMAT/GT | \
bcftools norm -f reference.fa -s -m +any -Ov > sample.vcf
python NextVpower.py -i sample.vcf -b virus_barcode.csv -o sample.demix_result.tsvThis project was published in Xiaoyi Lu, Zhenyu Guo, Langjun Tang, Junqiao Zhao, Yonghong Li, Kun Yang, Enhanced wastewater surveillance of respiratory viruses: Unraveling partitioning behavior and demixing co-circulating lineages, Environment International, Volume 204, 2025, 109836, ISSN 0160-4120,.
This project is licensed under the MIT License - see the LICENSE file for details.
