Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
apetkau committed May 27, 2019
2 parents 84cfb86 + 6b2215d commit 75575d5
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 30 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-----------------

Expand Down
6 changes: 3 additions & 3 deletions bin/consolidate_vcfs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";


Expand Down
8 changes: 4 additions & 4 deletions install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ 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

rm -rf $htslib
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
Expand All @@ -39,7 +39,7 @@ echo "Done!"

echo "Fetching and install bcftools"

bcftools='bcftools-1.5'
bcftools='bcftools-1.9'

if [ ! -d "$bcftools" ]; then

Expand All @@ -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
Expand Down
Binary file modified t/consolidate_vcfs_input/4/output/v1.bcf.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion t/tree/expected/5/phylogeneticTree.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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);
(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);
36 changes: 18 additions & 18 deletions t/tree/expected/5/revisedMatrix.csv
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 75575d5

Please sign in to comment.