A false-positive filter for variants called from massively parallel sequencing
Download the fpfilter.pl
script, and view the detailed usage manual:
curl -LO https://github.com/ckandoth/variant-filter/archive/master.zip; unzip master.zip
perl variant-filter-master/fpfilter.pl --help
Given snvs.vcf
a single sample VCF listing SNVs, generate a list of variant loci in a subfolder:
mkdir fpfilter
perl -ane 'print join("\t",@F[0,1,1])."\n" unless(m/^#/)' snvs.vcf > fpfilter/snvs.var
Given tumor.bam
, a BAM file containing the SNVs, and its reference FASTA grch37.fa
, run bam-readcount:
bam-readcount -q1 -b15 -w1 -l fpfilter/snvs.var -f grch37.fa tumor.bam > fpfilter/snvs.readcount
Run the fpfilter.pl
script using the readcounts as an input:
perl fpfilter.pl --var-file snvs.vcf --readcount-file fpfilter/snvs.readcount --output-file fpfilter/snvs.fpfilter
The last two columns of the resulting file snvs.fpfilter
contains a VCF friendly FILTER
code, and an extra column with details.
First, we need to install some dependencies. For Debian or Ubuntu, do the following:
sudo apt-get install build-essential git-core cmake zlib1g-dev libncurses-dev
For Fedora, CentOS6, or RHEL6, do the following instead:
sudo yum groupinstall "Development tools"
sudo yum install zlib-devel ncurses-devel cmake
Clone the bam-readcount repository, and recursively clone submodules:
git clone --recursive https://github.com/genome/bam-readcount.git
In-source builds are not supported, so create a subfolder named build, and build the source in there:
mkdir bam-readcount/build
cd bam-readcount/build
cmake ../
make deps
make
Install the bam-readcount
binary to /usr/bin
, or move it where your $PATH
can find it:
sudo make install
The original fpfilter.pl
script for filtering Single Nucleotide Variants (SNVs) was written by Dan Koboldt for VarScan, and Dave Larson for SomaticSniper. The latest version of the script is maintained by Dan, Dave, and other developers at the The Genome Institute, as a Perl module named FilterFalsePositives.pm. They even wrote a module named FilterFalseIndels.pm for small indels. However, those modules are not very portable, and have dependencies on their internal codebase. So this repository is my attempt to remove those dependencies, make it easier to use, and add other improvements like VCF support.
Cyriac Kandoth (ckandoth@gmail.com)
Dan Koboldt, Analysis Manager, Human Genetics Group, The Genome Institute
David Larson, Director of Bioinformatics, The Genome Institute