Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Dec 13, 2016
2 parents 4a268fa + 0810aa1 commit 2f3c4db
Show file tree
Hide file tree
Showing 10 changed files with 447 additions and 98 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ FROM ubuntu:16.04
MAINTAINER [email protected]

LABEL uk.ac.sanger.cgp="Cancer Genome Project, Wellcome Trust Sanger Institute" \
version="0.0" \
description="The CGP mapping pipeline 'in-a-box'"
version="1.0.0" \
description="The CGP mapping pipeline for dockstore.org"

USER root

ENV CGPBOX_VERSION $cgpbox_ver
ENV OPT /opt/wtsi-cgp
ENV PATH $OPT/bin:$PATH
ENV PERL5LIB $OPT/lib/perl5
Expand All @@ -19,15 +18,18 @@ RUN adduser --disabled-password --gecos '' ubuntu && chsh -s /bin/bash && mkdir
RUN mkdir -p $OPT/bin

ADD scripts/mapping.sh $OPT/bin/mapping.sh
RUN chmod a+x $OPT/bin/mapping.sh
ADD scripts/ds-wrapper.pl $OPT/bin/ds-wrapper.pl
RUN chmod a+x $OPT/bin/mapping.sh $OPT/bin/ds-wrapper.pl

ADD build/apt-build.sh build/
ADD build/perllib-build.sh build/
ADD build/opt-build.sh build/

RUN bash build/apt-build.sh
RUN bash build/perllib-build.sh
RUN bash build/opt-build.sh

USER ubuntu
WORKDIR /home/ubuntu

ENTRYPOINT /bin/bash
CMD ["/bin/bash"]
100 changes: 100 additions & 0 deletions Dockstore.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/env cwl-runner

class: CommandLineTool
id: "cgpmap"
label: "CGP BWA-mem mapping flow"
cwlVersion: v1.0
doc: |
![build_status](https://quay.io/repository/cancerit/dockstore-cgpmap/status)
A Docker container for the CGP BWA-mem mapping flow. See the [dockstore-cgpmap](https://github.com/cancerit/dockstore-cgpmap) website for more information.

dct:creator:
"@id": "http://orcid.org/0000-0002-5634-1539"
foaf:name: Keiran M Raine
foaf:mbox: "mailto:keiranmraine@gmail.com"

requirements:
- class: DockerRequirement
dockerPull: "quay.io/wtsicgp/dockstore-cgpmap:1.0.0"

hints:
- class: ResourceRequirement
coresMin: 1 # works but long, 8 recommended
ramMin: 15000 # good for WGS human ~30-60x
outdirMin: 5000000 # unlikely any BAM processing would be possible in less

inputs:
reference:
type: File
doc: "The core reference (fa, fai, dict) as tar.gz"
inputBinding:
prefix: -reference
position: 1
separate: true

bwa_idx:
type: File
doc: "The BWA indexes in tar.gz"
inputBinding:
prefix: -bwa_idx
position: 2
separate: true

sample:
type: string
doc: "Sample name to be included in output [B|CR]AM header, also used to name final file"
inputBinding:
prefix: -sample
position: 3
separate: true

scramble:
type: string?
doc: "Options to pass to scramble when generating CRAM output, see scramble docs"
default: ''
inputBinding:
prefix: -scramble
position: 4
separate: true
shellQuote: true

bwa:
type: string?
default: ' -Y -K 100000000'
doc: "Mapping and output parameters to pass to BWA-mem, see BWA docs, default ' -Y -K 100000000'"
inputBinding:
prefix: -bwa
position: 5
separate: true
shellQuote: false

cram:
type: boolean
doc: "Set if output should be in CRAM format instead of BAM, see 'scramble' for tuning parameters."
inputBinding:
prefix: -cram
position: 6

bams_in:
type:
- 'null'
- type: array
items: File
doc: "Can be BAM, CRAM, fastq (paired or interleaved), BAM/CRAM can be mixed together but not FASTQ."
inputBinding:
position: 7

outputs:
mapped_out:
type: File
outputBinding:
glob: $(inputs.sample).bam
secondaryFiles:
- .bai
- .bas
- .md5
- .met
- .maptime


baseCommand: ["/opt/wtsi-cgp/bin/ds-wrapper.pl"]
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
dockstore-cgpmap
======
`dockstore-cgpmap` provides a complete multi threaded BWA mem mapping workflow. This has been packaged specifically for use with the [Dockstore.org](https://dockstore.org/) framework.

Supports input in following formats:
* Multiple BAM
* Multiple CRAM
* Multiple fastq[.gz] (paired or interleaved)
* Please see [PCAP-core/bin/bwa_mem.pl](https://github.com/ICGC-TCGA-PanCancer/PCAP-core/blob/master/bin/bwa_mem.pl) for formatting of file names.

Options for customisation:

* BWA specific mapping parameters (defaults are based on attempts at a global standard).
* Optionally ouput CRAM (scramble parameters can be modified)

LICENCE
=======

Copyright (c) 2016 Genome Research Ltd.

Author: Cancer Genome Project <[email protected]>

This file is part of dockstore-cgpmap.

dockstore-cgpmap is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

1. The usage of a range of years within a copyright statement contained within
this distribution should be interpreted as being equivalent to a list of years
including the first and last year specified and all consecutive years between
them. For example, a copyright statement that reads ‘Copyright (c) 2005, 2007-
2009, 2011-2012’ should be interpreted as being identical to a statement that
reads ‘Copyright (c) 2005, 2007, 2008, 2009, 2011, 2012’ and a copyright
statement that reads ‘Copyright (c) 2005-2012’ should be interpreted as being
identical to a statement that reads ‘Copyright (c) 2005, 2006, 2007, 2008,
2009, 2010, 2011, 2012’."
5 changes: 1 addition & 4 deletions build/apt-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ apt-get -yq install apt-transport-https
apt-get -yq install autoconf
apt-get -yq install bsdtar
apt-get -yq install build-essential
apt-get -yq install ca-certificates
apt-get -yq install curl
apt-get -yq install libboost-dev
apt-get -yq install libboost-iostreams-dev
Expand All @@ -21,17 +20,15 @@ apt-get -yq install libpstreams-dev
apt-get -yq install libreadline6-dev
apt-get -yq install libssl-dev
apt-get -yq install nettle-dev
apt-get -yq install nfs-common
apt-get -yq install python-software-properties
apt-get -yq install s3cmd
apt-get -yq install software-properties-common
apt-get -yq install unzip
apt-get -yq install time
apt-get -yq install zlib1g-dev
apt-get -yq install libpam-tmpdir
apt-get -yq install libcairo2-dev

### security upgrades and cleanup
apt-get -yq install unattended-upgrades
unattended-upgrades
apt -yq autoremove
apt-get clean
18 changes: 0 additions & 18 deletions build/opt-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,4 @@ cd /tmp/downloads/distro
cd /tmp/downloads
rm -rf distro.zip /tmp/downloads/distro /tmp/hts_cache

# alleleCount
curl -sSL -o distro.zip --retry 10 https://github.com/cancerit/alleleCount/archive/v3.2.1.zip
mkdir /tmp/downloads/distro
bsdtar -C /tmp/downloads/distro --strip-components 1 -xf distro.zip
cd /tmp/downloads/distro
./setup.sh $OPT
cd /tmp/downloads
rm -rf distro.zip /tmp/downloads/distro

# cgpNgsQc
curl -sSL -o distro.zip --retry 10 https://github.com/cancerit/cgpNgsQc/archive/v1.3.0.zip
mkdir /tmp/downloads/distro
bsdtar -C /tmp/downloads/distro --strip-components 1 -xf distro.zip
cd /tmp/downloads/distro
./setup.sh $OPT
cd /tmp/downloads
rm -rf distro.zip /tmp/downloads/distro

rm -rf /tmp/downloads
104 changes: 104 additions & 0 deletions build/perllib-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash

set -eux

apt-get -yq update
# install all perl libs, identify by grep of cgp_box_stack build "grep 'Successfully installed' build_stack.log"
# much faster, items needing later versions will still upgrade
# still install those that get an upgrade though as dependancies will be resolved

## command to parse a build output before applying package based install
## some will need editign still
#grep '^Successfully installed ' build.log | perl -ne 's/ [(].+$/\n/;s/^.+ //;s/[-][^-]+$//;printf qq{apt-get -yq install lib%s-perl\n},lc $_;'

## commented items are up-to-date
apt-get -yq install libextutils-cbuilder-perl
apt-get -yq install libmodule-build-perl
apt-get -yq install libextutils-config-perl
apt-get -yq install libextutils-installpaths-perl
apt-get -yq install libextutils-helpers-perl
apt-get -yq install libmodule-build-tiny-perl
apt-get -yq install libfile-sharedir-install-perl
apt-get -yq install libclass-inspector-perl
apt-get -yq install libfile-sharedir-perl
#apt-get -yq install libsub-exporter-progressive-perl
apt-get -yq install libconst-fast-perl
apt-get -yq install libfile-which-perl
#apt-get -yq install libhtml-tagset-perl
#apt-get -yq install libhtml-parser-perl
#apt-get -yq install libencode-locale-perl
#apt-get -yq install liblwp-mediatypes-perl
#apt-get -yq install libhttp-date-perl
#apt-get -yq install libio-html-perl
#apt-get -yq install liburi-perl
#apt-get -yq install libhttp-message-perl
apt-get -yq install libhttp-cookies-perl
apt-get -yq install libhttp-negotiate-perl
apt-get -yq install libhttp-daemon-perl
apt-get -yq install libfile-listing-perl
apt-get -yq install libwww-robotrules-perl
apt-get -yq install libnet-http-perl
apt-get -yq install libwww-perl
apt-get -yq install libtest-deep-perl
apt-get -yq install libdevel-stacktrace-perl
apt-get -yq install libclass-data-inheritable-perl
apt-get -yq install libexception-class-perl
apt-get -yq install libsub-uplevel-perl
apt-get -yq install libtest-exception-perl
apt-get -yq install libtest-simple-perl
apt-get -yq install libcapture-tiny-perl
apt-get -yq install libtext-diff-perl
apt-get -yq install libtest-differences-perl
apt-get -yq install libtest-warn-perl
apt-get -yq install libtest-most-perl
apt-get -yq install libio-string-perl
apt-get -yq install libdata-stag-perl
apt-get -yq install libbio-perl-perl
apt-get -yq install libtest-leaktrace-perl
apt-get -yq install libappconfig-perl
apt-get -yq install libtemplate-perl
apt-get -yq install liblog-message-perl
apt-get -yq install liblog-message-simple-perl
apt-get -yq install libterm-ui-perl
apt-get -yq install libdevel-cover-perl
#apt-get -yq install libio-stringy-perl
apt-get -yq install libconfig-inifiles-perl
#apt-get -yq install libtry-tiny-perl
#apt-get -yq install libdevel-symdump-perl
apt-get -yq install libpod-coverage-perl
#apt-get -yq install libparams-util-perl
apt-get -yq install libtest-nowarnings-perl
#apt-get -yq install libclone-perl
apt-get -yq install libhook-lexwrap-perl
apt-get -yq install libtest-subcalls-perl
#apt-get -yq install libexporter-tiny-perl
apt-get -yq install libxsloader-perl
#apt-get -yq install liblist-moreutils-perl
apt-get -yq install libfile-remove-perl
apt-get -yq install libtest-object-perl
#apt-get -yq install libtask-weaken-perl
apt-get -yq install libppi-perl
apt-get -yq install libcss-tiny-perl
apt-get -yq install libppi-html-perl
apt-get -yq install libversion-perl
apt-get -yq install libdata-uuid-perl
apt-get -yq install libipc-system-simple-perl
apt-get -yq install libproc-processtable-perl
#apt-get -yq install libxml-sax-base-perl
#apt-get -yq install libxml-namespacesupport-perl
#apt-get -yq install libxml-sax-perl
#apt-get -yq install libxml-parser-perl
#apt-get -yq install libxml-sax-expat-perl
#apt-get -yq install libxml-simple-perl
apt-get -yq install libcanary-stability-perl
apt-get -yq install libcommon-sense-perl
apt-get -yq install libtypes-serialiser-perl
apt-get -yq install libjson-xs-perl
apt-get -yq install libproc-pid-file-perl
apt-get -yq install libtest-fatal-perl
apt-get -yq install libjson-perl

### security upgrades and cleanup
unattended-upgrades
apt -yq autoremove
apt-get clean
Loading

0 comments on commit 2f3c4db

Please sign in to comment.