Skip to content

Commit

Permalink
Merge pull request #54 from cancerit/feature/bwamem2
Browse files Browse the repository at this point in the history
Feature/bwamem2
  • Loading branch information
keiranmraine authored Feb 14, 2020
2 parents 7c6304d + 355b204 commit f392f47
Show file tree
Hide file tree
Showing 13 changed files with 494 additions and 47 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ script:
- docker run -t --rm pcap-core bam_stats --version
- docker run -t --rm pcap-core mismatchQc --version
- docker run -t --rm pcap-core bwa_mem.pl --version
- docker run -t --rm pcap-core merge_or_mark.pl --version
52 changes: 28 additions & 24 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGES

## NEXT

* Adds basic `merge_or_mark.pl` script for merging data generated by `bwa_mem.pl`.

## 4.4.1

* `bamToBw.pl` correct to send stdout/err to file when threads are active.
Expand Down Expand Up @@ -144,13 +148,13 @@ Handle recent changes to BioPerl structure
## 3.1.0

* Use BWA default for `-T` previously hard coded to `-T 0`.
* Can be passed through `bwa_mem.pl` other ags to bwa via the `-b` option.
* Fix `bam2bedgraph` compilation since changes to underlying libraries
* `bamToBw.pl` - expose read flag filters
* Drop dependancy on `Bio::DB::HTS INSTALL.pl` as can't fix to known good version.
* Added travis CI
* Add support for output directly to CRAM
* `bwa` version upgraded to [0.7.15](https://github.com/lh3/bwa/releases/tag/v0.7.15)
* Can be passed through `bwa_mem.pl` other ags to bwa via the `-b` option.
* Fix `bam2bedgraph` compilation since changes to underlying libraries
* `bamToBw.pl` - expose read flag filters
* Drop dependancy on `Bio::DB::HTS INSTALL.pl` as can't fix to known good version.
* Added travis CI
* Add support for output directly to CRAM
* `bwa` version upgraded to [0.7.15](https://github.com/lh3/bwa/releases/tag/v0.7.15)

## 3.0.0

Expand All @@ -170,16 +174,16 @@ Handle recent changes to BioPerl structure
## 2.0.0

* bwa_mem.pl
* allow user to specify BWA mapping parameters
* now accepts CRAM as input
* allow user to specify BWA mapping parameters
* now accepts CRAM as input
* bamToBw.pl - now accepts CRAM as input.
* bam_stats - Adds 2 new stats:
* `#_mapped_pairs`
* `#_inter_chr_pairs`
* `#_mapped_pairs`
* `#_inter_chr_pairs`
* Dependancy changes
* __WARNING__: ensure all related tools handle these updates
* [samtools](https://github.com/samtools/samtools/releases), now only uses htslib based versions (1.3+, handling deprecated use of sort)
* [Bio::DB::HTS](http://search.cpan.org/~rishidev/Bio-DB-HTS/lib/Bio/DB/HTS.pm) htslib bindings replacing Bio::DB::Sam
* __WARNING__: ensure all related tools handle these updates
* [samtools](https://github.com/samtools/samtools/releases), now only uses htslib based versions (1.3+, handling deprecated use of sort)
* [Bio::DB::HTS](http://search.cpan.org/~rishidev/Bio-DB-HTS/lib/Bio/DB/HTS.pm) htslib bindings replacing Bio::DB::Sam

## 1.14.0

Expand Down Expand Up @@ -225,8 +229,8 @@ Handle recent changes to BioPerl structure
## 1.5.4

* bam_stats C
* Reference file parameter is now optional to replicate bam_stats.pl functionality.
* Warnings in help, and when a cram file is given as reference from header may not be found, and bam stats will fail.
* Reference file parameter is now optional to replicate bam_stats.pl functionality.
* Warnings in help, and when a cram file is given as reference from header may not be found, and bam stats will fail.

## 1.5.3

Expand All @@ -235,9 +239,9 @@ Handle recent changes to BioPerl structure

## 1.5.2

bamToBw.pl fixes
* Pull actual binaries from jkent_util not html page associated
* process name corrections in bamToBw.pm command line args
* bamToBw.pl fixes
* Pull actual binaries from jkent_util not html page associated
* process name corrections in bamToBw.pm command line args

## 1.5.1

Expand Down Expand Up @@ -305,16 +309,16 @@ and potentially unstable in future.
## 1.0.2

* Upgrade install to pull biobambam 0.0.138
* fastqtobam option 'pairedfile' for where readnames don't have trailing '/1' or '/2'.
* fastqtobam option to relax qscore validation without turning off... careful
* fastqtobam option 'pairedfile' for where readnames don't have trailing '/1' or '/2'.
* fastqtobam option to relax qscore validation without turning off... careful
* Upgrade install to pull BWA 0.7.8
* performance improvements for short read alignment (100bp)
* performance improvements for short read alignment (100bp)

## 1.0.1

* Upgrade install to pull biobambam 0.0.135
* fastqtobam supports Casava v1.8
* bamsort supports NM/MD correction during sam->bam/merge process
* fastqtobam supports Casava v1.8
* bamsort supports NM/MD correction during sam->bam/merge process
* Minor enhancement to BAS reader module.
* Sample name from command line passed through to SM of RG header in bwa_mem.pl
* SRA.pm - check that rg id is unique within run of code (thanks to Junjun Zhang)
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM quay.io/wtsicgp/cgpbigwig:1.1.0 as builder

USER root

ARG VER_BBB2="2.0.87-release-20180301132713"
ARG VER_BIODBHTS="2.10"
ARG BBB2_URL="https://gitlab.com/german.tischler/biobambam2/uploads/178774a8ece96d2201fcd0b5249884c7/biobambam2-2.0.146-release-20191030105216-x86_64-linux-gnu.tar.xz"
ARG BWAMEM2_URL="https://github.com/bwa-mem2/bwa-mem2/releases/download/v2.0pre2/bwa-mem2-2.0pre2_x64-linux.tar.bz2"
ARG STADEN="https://iweb.dl.sourceforge.net/project/staden/staden/2.0.0b11/staden-2.0.0b11-2016-linux-x86_64.tar.gz"
ARG VER_BIODBHTS="3.01"
ARG VER_BWA="v0.7.17"
ARG VER_HTSLIB="1.9"
ARG VER_SAMTOOLS="1.9"
Expand Down Expand Up @@ -60,10 +62,10 @@ LABEL maintainer="cgphelp@sanger.ac.uk"\
description="pcap-core"

ENV OPT /opt/wtsi-cgp
ENV PATH $OPT/bin:$OPT/biobambam2/bin:$PATH
ENV PATH $OPT/bin:$OPT/biobambam2/bin:$OPT/scramble/bin:$PATH
ENV PATH $OPT/bin:$PATH
ENV PERL5LIB $OPT/lib/perl5
ENV LD_LIBRARY_PATH $OPT/lib
ENV LD_LIBRARY_PATH $OPT/lib:$OPT/scramble/lib
ENV LC_ALL C

RUN apt-get -yq update
Expand All @@ -80,6 +82,8 @@ zlib1g \
liblzma5 \
libncurses5 \
p11-kit \
libcurl3 \
moreutils \
unattended-upgrades && \
unattended-upgrade -d -v && \
apt-get remove -yq unattended-upgrades && \
Expand Down
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ apt-get -yqq install \
lsof \
time \
libgd-perl \
psmisc
psmisc \
moreutils
```

### Amazon Linux AMI
Expand Down
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ WriteMakefile(
EXE_FILES => [qw( bin/bwa_aln.pl
bin/bwa_mem.pl
bin/bamToBw.pl
bin/merge_or_mark.pl
bin/xam_coverage_bins.pl )],
PREREQ_PM => {
'Module::Build' => 0.42,
Expand Down
11 changes: 4 additions & 7 deletions bin/bwa_mem.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

##########LICENCE##########
# PCAP - NGS reference implementations and helper code for the ICGC/TCGA Pan-Cancer Analysis Project
# Copyright (C) 2014-2018 ICGC PanCancer Project
# Copyright (C) 2014-2020 ICGC PanCancer Project
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -52,7 +52,7 @@
my $options = setup();

my $threads = PCAP::Threaded->new($options->{'threads'});
&PCAP::Threaded::disable_out_err if(!exists $options->{'index'} && $options->{'threads'} == 1);
&PCAP::Threaded::disable_out_err if(exists $options->{'index'});

# register processes
$threads->add_function('split', \&PCAP::Bwa::split_in);
Expand Down Expand Up @@ -98,8 +98,8 @@ sub setup {
'm|man' => \$opts{'m'},
'v|version' => \$opts{'v'},
'j|jobs' => \$opts{'jobs'},
't|threads=i' => \$opts{'threads'},
'mt|map_threads=i' => \$opts{'map_threads'},
't|threads:i' => \$opts{'threads'},
'mt|map_threads:i' => \$opts{'map_threads'},
'r|reference=s' => \$opts{'reference'},
'o|outdir=s' => \$opts{'outdir'},
's|sample=s' => \$opts{'sample'},
Expand All @@ -125,9 +125,6 @@ sub setup {
exit 0;
}

my $version = PCAP::Bwa::bwa_version();
die "bwa mem can only be used with bwa version 0.7+, the version found in path is: $version\n" unless(version->parse($version) >= version->parse('0.7.0'));

# then check for no args:
my $defined;
for(keys %opts) { $defined++ if(defined $opts{$_}); }
Expand Down
Loading

0 comments on commit f392f47

Please sign in to comment.