diff --git a/CHANGELOG.md b/CHANGELOG.md index 361e0d8..122d731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changes +## 1.8.2 + +* Update bcftools from 1.5 to version 1.9 +* Update consolidate_vcf.pl to new standard of bcftools version 1.9 + ## 1.8.1 * Re-structured repository to use a `Makefile.PL` for handling installation/dependency checking. For integration with Bioconda. diff --git a/README.md b/README.md index 15a42c8..9d244c8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ conda install snvphyl-tools ### 2. Install dependencies using install_deps.sh -Script will download and compile in the current working directory [bcftools](http://www.htslib.org/),[htslib](http://www.htslib.org/), [Mummer](http://mummer.sourceforge.net/) and [Vcftools](https://vcftools.github.io/index.html). +Script will download and compile in the current working directory [bcftools](http://www.htslib.org/),[htslib](http://www.htslib.org/), [Mummer](http://mummer.sourceforge.net/) and [Vcftools](https://vcftools.github.io/index.html). Note that [samtools](http://www.htslib.org/) version 1.9 needs to be available on the PATH and will not be installed by install_deps.sh . #### Step a: Install Dependencies @@ -45,11 +45,16 @@ cd snvphyl-tools ./install_deps.sh #wait patiently to completion and setup the following environment variables #example below -export PATH=/home/test/snvphyl-tools/bcftools-1.5:/home/test/snvphyl-tools/MUMmer3.23:$PATH -export BCFTOOLS_PLUGINS=/home/test//snvphyl-tools/bcftools-1.5/plugins -PERL5LIB=/home/test/snvphyl-tools/lib/perl5 +export PATH=/home/test/snvphyl-tools/bcftools-1.9:/home/test/snvphyl-tools/MUMmer3.23:$PATH +export BCFTOOLS_PLUGINS=/home/test//snvphyl-tools/bcftools-1.9/plugins +export PERL5LIB=/home/test/snvphyl-tools/lib/perl5 + +#Install samtools 1.9 +#if conda available, use command below, else build with source or apt/yum +#conda install samtools samtools==1.9 ``` + #### Step b: Run Tests ----------------- diff --git a/bin/consolidate_vcfs.pl b/bin/consolidate_vcfs.pl index 81569c2..0d1f27d 100755 --- a/bin/consolidate_vcfs.pl +++ b/bin/consolidate_vcfs.pl @@ -65,10 +65,10 @@ sub combine_vcfs{ #if we are using vcf files, need to convert first to vcf before applying the filter. The reason is bug with bcftools where SOME files will put the wrong FLAG in.... if ( $ext eq '.vcf.gz') { - $cmd = "$bcftools view $mpileup -O v | $bcftools filter -s 'coverage' -i 'DP>=$coverage_cutoff || DP4[0]+DP4[1]>=$coverage_cutoff' $out_type > $dir/coverage_mpileup$ext"; + $cmd = "$bcftools view $mpileup -O v | $bcftools filter -s 'coverage' -i 'INFO/DP>=$coverage_cutoff || INFO/DP4[0]+INFO/DP4[1]>=$coverage_cutoff' $out_type > $dir/coverage_mpileup$ext"; } else { - $cmd = "$bcftools filter -s 'coverage' -i 'DP>=$coverage_cutoff || DP4[0]+DP4[1]>=$coverage_cutoff' $mpileup $out_type > $dir/coverage_mpileup$ext"; + $cmd = "$bcftools filter -s 'coverage' -i 'INFO/DP>=$coverage_cutoff || INFO/DP4[0]+INFO/DP4[1]>=$coverage_cutoff' $mpileup $out_type > $dir/coverage_mpileup$ext"; } system($cmd) == 0 or die "Could not run $cmd"; @@ -127,7 +127,7 @@ sub combine_vcfs{ #if either of them fail, it will be hard clip out. #NB that not sure how it handles when have multiple different alternative alleles #also hard clipping ones that fail filtering. Do not want to have them appear in the snvalign-positions since they never passed - $cmd = "$bcftools filter -m + -e 'MQM<$min_mean_mapping || AO/DP<$ao' $dir/0002$ext $out_type > $dir/1-0002$ext && bcftools index $dir/1-0002$ext"; + $cmd = "$bcftools filter -m + -e 'MQM<$min_mean_mapping || INFO/AO/INFO/DP<$ao' $dir/0002$ext $out_type > $dir/1-0002$ext && bcftools index $dir/1-0002$ext"; system($cmd) == 0 or die "Could not run $cmd"; diff --git a/install_deps.sh b/install_deps.sh index 9f54124..df2ce3a 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -14,7 +14,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo "Fetching and installing htslib..."; #installing all dependencies for building bcftools and our plugin -htslib='htslib-1.5' +htslib='htslib-1.9' if [ ! -d "$htslib" ]; then @@ -22,7 +22,7 @@ if [ ! -d "$htslib" ]; then fi -curl -s https://codeload.github.com/samtools/htslib/tar.gz/1.5 > htslib.tar.gz +curl -s https://codeload.github.com/samtools/htslib/tar.gz/1.9 > htslib.tar.gz tar -zxf htslib.tar.gz #clean up rm htslib.tar.gz @@ -39,7 +39,7 @@ echo "Done!" echo "Fetching and install bcftools" -bcftools='bcftools-1.5' +bcftools='bcftools-1.9' if [ ! -d "$bcftools" ]; then @@ -48,7 +48,7 @@ fi -curl -s https://codeload.github.com/samtools/bcftools/tar.gz/1.5 > bcftools.tar.gz +curl -s https://codeload.github.com/samtools/bcftools/tar.gz/1.9 > bcftools.tar.gz tar -zxf bcftools.tar.gz #clean up diff --git a/t/consolidate_vcfs_input/4/output/v1.bcf.gz b/t/consolidate_vcfs_input/4/output/v1.bcf.gz index 5f79fc7..5c7a761 100644 Binary files a/t/consolidate_vcfs_input/4/output/v1.bcf.gz and b/t/consolidate_vcfs_input/4/output/v1.bcf.gz differ diff --git a/t/tree/expected/5/phylogeneticTree.txt b/t/tree/expected/5/phylogeneticTree.txt old mode 100755 new mode 100644 index 437205d..7fe5f5b --- a/t/tree/expected/5/phylogeneticTree.txt +++ b/t/tree/expected/5/phylogeneticTree.txt @@ -1 +1 @@ -(VC-10:0.000000,VC-1:0.000000,(C6706:1.284387,(3554-08:0.000000,(VC-19:0.000000,(VC-6:0.000000,(2011EL-2317:0.000000,((2010EL-1796:0.000000,2010EL-1786-c1_2000_2400kb:0.075801):0.000003,((VC-18:0.000000,VC-15:0.000000):0.036948,((VC-26:0.000000,(VC-25:0.000000,VC-14:0.000000):0.000000):0.036826,(2010EL-1798:0.000000,(2012V-1001:0.038164,2010EL-1749:0.038164):0.038285):0.000003):0.000003):0.000003):0.000002):0.036659):0.000003):0.000004):0.023159):0.092602); \ No newline at end of file +(VC-1:0.000000,VC-10:0.000000,(C6706:1.284387,(3554-08:0.000000,(VC-19:0.000000,(VC-6:0.000000,(2011EL-2317:0.000000,((2010EL-1786-c1_2000_2400kb:0.075801,2010EL-1796:0.000000):0.000003,((VC-15:0.000000,VC-18:0.000000):0.036948,((VC-26:0.000000,(VC-14:0.000000,VC-25:0.000000):0.000000):0.036826,(2010EL-1798:0.000000,(2010EL-1749:0.038164,2012V-1001:0.038164):0.038285):0.000003):0.000003):0.000003):0.000002):0.036659):0.000003):0.000004):0.023159):0.092602); \ No newline at end of file diff --git a/t/tree/expected/5/revisedMatrix.csv b/t/tree/expected/5/revisedMatrix.csv old mode 100755 new mode 100644 index 6d0bad9..6d5ea1d --- a/t/tree/expected/5/revisedMatrix.csv +++ b/t/tree/expected/5/revisedMatrix.csv @@ -1,18 +1,18 @@ -strain VC-10 VC-1 C6706 3554-08 VC-19 VC-6 2011EL-2317 2010EL-1796 2010EL-1786-c1_2000_2400kb VC-18 VC-15 VC-26 VC-25 VC-14 2010EL-1798 2012V-1001 2010EL-1749 -VC-10 0 0 19 3 3 3 4 4 6 5 5 5 5 5 4 6 6 -VC-1 0 0 19 3 3 3 4 4 6 5 5 5 5 5 4 6 6 -C6706 19 19 0 18 18 18 19 19 21 20 20 20 20 20 19 21 21 -3554-08 3 3 18 0 0 0 1 1 3 2 2 2 2 2 1 3 3 -VC-19 3 3 18 0 0 0 1 1 3 2 2 2 2 2 1 3 3 -VC-6 3 3 18 0 0 0 1 1 3 2 2 2 2 2 1 3 3 -2011EL-2317 4 4 19 1 1 1 0 0 2 1 1 1 1 1 0 2 2 -2010EL-1796 4 4 19 1 1 1 0 0 2 1 1 1 1 1 0 2 2 -2010EL-1786-c1_2000_2400kb 6 6 21 3 3 3 2 2 0 3 3 3 3 3 2 4 4 -VC-18 5 5 20 2 2 2 1 1 3 0 0 2 2 2 1 3 3 -VC-15 5 5 20 2 2 2 1 1 3 0 0 2 2 2 1 3 3 -VC-26 5 5 20 2 2 2 1 1 3 2 2 0 0 0 1 3 3 -VC-25 5 5 20 2 2 2 1 1 3 2 2 0 0 0 1 3 3 -VC-14 5 5 20 2 2 2 1 1 3 2 2 0 0 0 1 3 3 -2010EL-1798 4 4 19 1 1 1 0 0 2 1 1 1 1 1 0 2 2 -2012V-1001 6 6 21 3 3 3 2 2 4 3 3 3 3 3 2 0 2 -2010EL-1749 6 6 21 3 3 3 2 2 4 3 3 3 3 3 2 2 0 +strain VC-1 VC-10 C6706 3554-08 VC-19 VC-6 2011EL-2317 2010EL-1786-c1_2000_2400kb 2010EL-1796 VC-15 VC-18 VC-26 VC-14 VC-25 2010EL-1798 2010EL-1749 2012V-1001 +VC-1 0 0 19 3 3 3 4 6 4 5 5 5 5 5 4 6 6 +VC-10 0 0 19 3 3 3 4 6 4 5 5 5 5 5 4 6 6 +C6706 19 19 0 18 18 18 19 21 19 20 20 20 20 20 19 21 21 +3554-08 3 3 18 0 0 0 1 3 1 2 2 2 2 2 1 3 3 +VC-19 3 3 18 0 0 0 1 3 1 2 2 2 2 2 1 3 3 +VC-6 3 3 18 0 0 0 1 3 1 2 2 2 2 2 1 3 3 +2011EL-2317 4 4 19 1 1 1 0 2 0 1 1 1 1 1 0 2 2 +2010EL-1786-c1_2000_2400kb 6 6 21 3 3 3 2 0 2 3 3 3 3 3 2 4 4 +2010EL-1796 4 4 19 1 1 1 0 2 0 1 1 1 1 1 0 2 2 +VC-15 5 5 20 2 2 2 1 3 1 0 0 2 2 2 1 3 3 +VC-18 5 5 20 2 2 2 1 3 1 0 0 2 2 2 1 3 3 +VC-26 5 5 20 2 2 2 1 3 1 2 2 0 0 0 1 3 3 +VC-14 5 5 20 2 2 2 1 3 1 2 2 0 0 0 1 3 3 +VC-25 5 5 20 2 2 2 1 3 1 2 2 0 0 0 1 3 3 +2010EL-1798 4 4 19 1 1 1 0 2 0 1 1 1 1 1 0 2 2 +2010EL-1749 6 6 21 3 3 3 2 4 2 3 3 3 3 3 2 0 2 +2012V-1001 6 6 21 3 3 3 2 4 2 3 3 3 3 3 2 2 0