This repository contains Longshot2 (implemented in python) that implements a two-pass approach to variant calling (both SNVs and short indels) for long reads. Longshot2 uses a C++ implementation of the POA algorithm (https://github.com/rvaser/spoa) and the Longshot tool (github.com/pjedge/longshot). Longshot2 also allows for runningthe variant calling in parallel resulting in significant speed-up.
Longshot is a variant calling tool for diploid genomes using long error prone reads such as Pacific Biosciences (PacBio) SMRT and Oxford Nanopore Technologies (ONT) available from https://github.com/pjedge/longshot
- In the first pass, SNVs are called using Longshot and reads are separated by haplotype
- POA-based consensus algorithm is applied to the haplotype-separated reads to identify variants (both SNVs and indels)
- POA-based variants are merged with the SNVs from step (1) using bcftools
- The merged set of variants are used as input for a second run of Longshot
- Download and compile the python wrapper for C++ spoa library:
git clone https://github.com/vibansal/spoa_python.git
cd spoa_python
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
cd ..
python3.x setup.py build_ext --inplace
cd ..
cp -r spoa_python/spoa .
-
Install longshot (https://github.com/pjedge/longshot)
-
Install other dependencies: bgzip, tabix, bcftools
-
edit the config.txt to change the path to longshot and bcftools
python3.6 longshot2.py [args]
The python program expects the same arguments as used for longshot. If the "--region" option is not provided, all chromosomes/contigs are processed separately and the VCF files are merged.
Example command:
python3.6 longshot2.py --bam HG002.longreads.bam --region chr20 --ref GRCh38.fasta --out HG002.chr20.longshot2.vcf