Skip to content

Commit

Permalink
Merge branch 'release/v3.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Mar 25, 2018
2 parents ac22044 + 2a37729 commit 772d703
Show file tree
Hide file tree
Showing 18 changed files with 169 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ addons:
- libcairo2-dev # give png.h for kentsrc and used by R in later components
- time
- curl
- r-base-dev

install: true

Expand All @@ -45,6 +46,8 @@ script:
- ./setup.sh $HOME/alleleCount-opt $HOME/cgpVcf-opt/lib/perl5:$HOME/PCAP-opt/lib/perl5
- cd ../
- ./setup.sh $HOME/cgpBattenberg-opt $HOME/alleleCount-opt/lib/perl5:$HOME/cgpVcf-opt/lib/perl5:$HOME/PCAP-opt/lib/perl5
- cd Rsupport
- ./setupR.sh $HOME/cgpBattenberg-opt

dist: trusty
sudo: false
30 changes: 23 additions & 7 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
### 3.2.2
# Changes

## 3.3.0

* Upgrade to Battenberg [v2.2.8](https://github.com/Wedge-Oxford/battenberg/releases/tag/v2.2.8).
* Upgrade to ASCAT [2.5.1](https://github.com/Crick-CancerGenomics/ascat/releases/tag/v2.5.1).
* Docs now indicate you should run the R install scripts.
* Email and licence updates

## 3.2.2

* Fix to README rendering of link

### 3.2.1
## 3.2.1

* Updates to documentation

### 3.2.0
## 3.2.0

* Install Battenberg R code from GitHub

### 3.1.0
## 3.1.0

* Use newer alleleCount that includes faster 'dense snps' option
* Minor modification to README.md layout

### 3.0.2
## 3.0.2

* Moved call to create 1000genome loci filename hash to before use of threads to avoid glob bug in perl 5.16.3

### 3.0.1
## 3.0.1

* Bug fix when there are regions which have no copynumber values set which caused bb_vcf_to_ascat_cn.pl to crash

### 3.0.0
## 3.0.0

* Use verion 2.2.5 of the battenberg R package
* Removed R files from repository
89 changes: 69 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,63 @@
cgpBattenberg
=============
# cgpBattenberg

An installation helper, perl wrapper and the R program Battenberg which detects subclonality and copy number in matched NGS data.
An installation helper, perl wrapper and the R program Battenberg which detects subclonality and
copy number in matched NGS data.

| Master | Dev |
|---|---|
| [![Build Status](https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=master)](https://travis-ci.org/cancerit/cgpBattenberg) | [![Build Status](https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=dev)](https://travis-ci.org/cancerit/cgpBattenberg) |
| Master | Develop |
| --------------------------------------------- | ----------------------------------------------- |
| [![Master Badge][travis-master]][travis-base] | [![Develop Badge][travis-develop]][travis-base] |

**_This is only suitable for WGS analysis_**.

<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Battenberg R code](#battenberg-r-code)
- [Docker, Singularity and Dockstore](#docker-singularity-and-dockstore)
- [Installation](#installation)
- [Prerequisites](#prerequisites)
- [Program Run Instructions](#program-run-instructions)

<!-- /TOC -->

## Battenberg R code
The Battenberg R code is developed and maintained in a separate repository [here](https://github.com/Wedge-Oxford/battenberg) and this is where any questions or issues specific to the R code should be directed.

The Battenberg R code is maintained in a separate repository [Wedge-Oxford/battenberg][bb-repo]
and this is where any questions or issues specific to the R code should be directed.

## Docker, Singularity and Dockstore

There is a pre-built image containing this codebase on quay.io.

* [dockstore-cgpwgs][ds-cgpwgs-git]: Contains additional tools for WGS analysis.

This was primarily designed for use with dockstore.org but can be used as normal containers.

The docker images are know to work correctly after import into a singularity image.

## Installation

The battenberg R files are installed automatically from the Battenberg GitHub repository found [here](https://github.com/Wedge-Oxford/battenberg). The linked version is currently [`v2.2.5`](https://github.com/Wedge-Oxford/battenberg/releases/tag/v2.2.5).
The battenberg R files are installed automatically from the Battenberg GitHub repository found
[here][bb-repo]. The linked version is currently [`v2.2.5`][bb-ver-link].

Please install the following first:

1. [PCAP-core v2.1.3+][pcap-core-rel]
1. [alleleCount v3.3.1+][allele-count-rel]
1. [cgpVcf v2.0.1+][cgpvcf-rel]

Please install the following before attempting to run ``setup.sh <install_to_folder> [X/lib/perl:Y/lib/perl]``
Then execute:

1. [PCAP-core v2.1.3+](https://github.com/cancerit/PCAP-core/releases)
2. [alleleCount v3.0.1+](https://github.com/cancerit/alleleCount/releases)
3. [cgpVcf v2.0.1+](https://github.com/cancerit/cgpVcf/releases)
```
setup.sh <install_to_folder> [X/lib/perl:Y/lib/perl]
cd Rsupport
./setupR.sh <install_to_folder>/R-libs
```

All of the items listed here use the same install method.

### Prerequisites

* Impute2 executables can be found [here](https://mathgen.stats.ox.ac.uk/impute/impute_v2.html)
* Impute2 executables can be found [here][impute-exe]
* Any impute related data for download
* BWA Mapped, indexed, duplicate marked/removed bam files, for both a matched normal and tumour sample
* Reference.fasta and index
Expand All @@ -39,23 +72,22 @@ Some required data files are not included in the distribution but a script is in
* Prob loci file probloci.txt
* Included: ``files/probloci.txt.gz``

Additionally, the wgs_gc_correction_1000g files need to be downloaded. These can be obtained from the Battenberg R code site [here](https://github.com/Wedge-Oxford/battenberg#required-reference-files).
Additionally, the wgs_gc_correction_1000g files need to be downloaded. These can be obtained from the Battenberg R code site [here][bb-ref].

## Program Run Instructions

For the most up to date usage instructions for the wrapper code please see the command line help:

battenberg.pl -h

Please check the [wiki](https://github.com/cancerit/cgpBattenberg/wiki) for common problems before raising any issues.
Please check the [wiki][cgpbb-wiki] for common problems before raising any issues.

----
# LICENCE

LICENCE
=======
Copyright (c) 2014-2017 Genome Research Ltd.
```
Copyright (c) 2014-2018 Genome Research Ltd.

Author: Cancer Genome Project cgpit@sanger.ac.uk
Author: Cancer Genome Project <cgphelp@sanger.ac.uk>

This file is part of cgpBattenberg.

Expand All @@ -81,3 +113,20 @@ 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'."
```

<!-- Travis -->
[travis-base]: https://travis-ci.org/cancerit/cgpBattenberg
[travis-master]: https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=master
[travis-develop]: https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=dev

<!-- refs -->
[pcap-core-rel]: https://github.com/cancerit/PCAP-core/releases
[allele-count-rel]: https://github.com/cancerit/alleleCount/releases
[cgpvcf-rel]: https://github.com/cancerit/cgpVcf/releases
[impute-exe]: https://mathgen.stats.ox.ac.uk/impute/impute_v2.html
[bb-ref]: https://github.com/Wedge-Oxford/battenberg#required-reference-files
[cgpbb-wiki]: https://github.com/cancerit/cgpBattenberg/wiki
[bb-repo]: https://github.com/Wedge-Oxford/battenberg
[bb-ver-link]: https://github.com/Wedge-Oxford/battenberg/releases/tag/v2.2.5
[ds-cgpwgs-git]: https://github.com/cancerit/dockstore-cgpwgs
35 changes: 30 additions & 5 deletions Rsupport/libInstall.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,39 @@ instLib = args[1]
ascatPackage = args[2]
battenbergPackage = args[3]

#Use earier version because current version in cran is not compatible with R < 3.2 (dir.exists).
stringi_for_legacyR = "http://cran.uk.r-project.org/src/contrib/Archive/stringi/stringi_1.1.6.tar.gz"

ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
biocLite(new.pkg, ask=FALSE, lib=instLib, lib.loc=instLib)
sapply(pkg, library, character.only = TRUE)
}

r = getOption("repos") # hard code the UK repo for CRAN
r["CRAN"] = "http://cran.uk.r-project.org"
options(repos = r)
rm(r)
#Use previous version because current version in cran is not compatible with R < 3.2 (dir.exists).
install.packages("http://cran.uk.r-project.org/src/contrib/Archive/stringi/stringi_1.1.2.tar.gz", repos=NULL, type="source")
install.packages("RColorBrewer")
install.packages("ggplot2")
install.packages("readr")
source("http://bioconductor.org/biocLite.R")

biocPackages <- c("devtools")
ipak(biocPackages)
library(devtools)
options(download.file.method = "auto")

if ( version$major > 3 || ( version$major == 3 && version$minor >= 2 )) {
ipak(c("stringi"))
} else {
install.packages(stringi_for_legacyR, repos=NULL, type="source")
}

ipak("readr")
ipak("ggplot2")
ipak("doParallel")
ipak("RColorBrewer")
ipak("gridExtra")
ipak("gtools")

install.packages(ascatPackage)
install.packages(battenbergPackage)
13 changes: 8 additions & 5 deletions Rsupport/setupR.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

########## LICENCE ##########
# Copyright (c) 2014-2017 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: Cancer Genome Project <cgpit@sanger.ac.uk>
# Author: Cancer Genome Project <cgphelp@sanger.ac.uk>
#
# This file is part of BRASS.
#
Expand Down Expand Up @@ -40,6 +40,9 @@ fi
INST_PATH=$1
BUILD_R=$2

VERSION_ASCAT='2.5.1' # no 'v', not a project archive an artifact
VERSION_BB='v2.2.8' # with 'v', this is a project archive

CPU=`grep -c ^processor /proc/cpuinfo`
if [ $? -eq 0 ]; then
if [ "$CPU" -gt "6" ]; then
Expand Down Expand Up @@ -81,10 +84,10 @@ if [ "x$BUILD_R" != "x" ]; then
cd $TMP_DIR
fi

wget https://github.com/Crick-CancerGenomics/ascat/releases/download/v2.4.3/ASCAT_2.4.3.tar.gz
wget https://github.com/Wedge-Oxford/battenberg/archive/v2.2.5.tar.gz
curl -sSL https://github.com/Crick-CancerGenomics/ascat/releases/download/v${VERSION_ASCAT}/ASCAT_${VERSION_ASCAT}.tar.gz > ascat_R.tar.gz
curl -sSL https://github.com/Wedge-Oxford/battenberg/archive/$VERSION_BB.tar.gz > BB_R.tar.gz

Rscript $INIT_DIR/libInstall.R $R_LIBS_USER $TMP_DIR/ASCAT_2.4.3.tar.gz $TMP_DIR/v2.2.5.tar.gz
Rscript $INIT_DIR/libInstall.R $R_LIBS_USER ascat_R.tar.gz BB_R.tar.gz 2>&1 | grep '^\*'

cd $INIT_DIR
rm -rf $TMP_DIR
4 changes: 2 additions & 2 deletions perl/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/perl

########## LICENCE ##########
# Copyright (c) 2014 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: CancerIT <cgpit@sanger.ac.uk>
# Author: CancerIT <cgphelp@sanger.ac.uk>
#
# This file is part of cgpBattenberg.
#
Expand Down
16 changes: 13 additions & 3 deletions perl/bin/battenberg.pl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/perl

##########LICENCE##########
# Copyright (c) 2014-2017 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: Cancer Genome Project cgpit@sanger.ac.uk
# Author: Cancer Genome Project <cgphelp@sanger.ac.uk>
#
# This file is part of cgpBattenberg.
#
Expand Down Expand Up @@ -192,11 +192,17 @@ sub setup {
'nl|num_loci_files=i' => \$opts{'num_loci_files'},
'se|seed=i' => \$opts{'seed'},
'sb|calc_seg_baf_option=i' => \$opts{'calc_seg_baf_option'},
'v|version' => \$opts{'version'},
) or pod2usage(2);

pod2usage(-verbose => 0, -exitval => 0) if(defined $opts{'h'});
pod2usage(-verbose => 2, -exitval => 0) if(defined $opts{'m'});

if(defined $opts{'version'}) {
print 'Version: '.Sanger::CGP::Battenberg->VERSION,"\n";
exit 0;
}

# then check for no args:
my $defined;
for(keys %opts) { $defined++ if(defined $opts{$_}); }
Expand Down Expand Up @@ -271,6 +277,10 @@ sub setup {
pod2usage(-msg => "\nERROR: Invalid pr|protocol '$opts{protocol}'.\n", -verbose => 1, -output => \*STDERR) if($bad_prot);
}

if($opts{'reference'} !~ m/\.fai$/) {
warn "Automatically appending '.fai' to end of '-reference' option (see usage)\n";
$opts{'reference'} .= '.fai';
}
PCAP::Cli::file_for_reading('reference',$opts{'reference'});

my $no_of_jobs = Sanger::CGP::Battenberg::Implement::file_line_count_with_ignore($opts{'reference'},$opts{'ignored_contigs'});
Expand Down Expand Up @@ -471,6 +481,7 @@ =head1 SYNOPSIS
-num_loci_files -nl Split the 1000genomes loci files into this many files. Defining a value less than the number of loci files will have no effect.

Other:
-version -v Version.
-help -h Brief help message.
-man -m Full documentation.

Expand Down Expand Up @@ -680,4 +691,3 @@ =head1 DESCRIPTION
B<battenberg.pl> will attempt to run all caveman steps automatically including collation of output files.

=cut

4 changes: 2 additions & 2 deletions perl/bin/battenberg_CN_to_VCF.pl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/perl

##########LICENCE##########
# Copyright (c) 2014-2016 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: David Jones <cgpit@sanger.ac.uk>
# Author: David Jones <cgphelp@sanger.ac.uk>
#
# This file is part of cgpBattenberg.
#
Expand Down
4 changes: 2 additions & 2 deletions perl/bin/battenberg_version.pl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/perl

##########LICENCE##########
# Copyright (c) 2014 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: Cancer Genome Project cgpit@sanger.ac.uk
# Author: Cancer Genome Project <cgphelp@sanger.ac.uk>
#
# This file is part of cgpBattenberg.
#
Expand Down
4 changes: 2 additions & 2 deletions perl/bin/bb_vcf_to_ascat_cn.pl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/perl

##########LICENCE##########
# Copyright (c) 2016-2017 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: David Jones <cgpit@sanger.ac.uk>
# Author: David Jones <cgphelp@sanger.ac.uk>
#
# This file is part of cgpBattenberg.
#
Expand Down
4 changes: 2 additions & 2 deletions perl/bin/download_generate_bberg_ref_files.pl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/perl

##########LICENCE##########
# Copyright (c) 2014 Genome Research Ltd.
# Copyright (c) 2014-2018 Genome Research Ltd.
#
# Author: David Jones <cgpit@sanger.ac.uk>
# Author: David Jones <cgphelp@sanger.ac.uk>
#
# This file is part of cgpBattenberg.
#
Expand Down
Binary file modified perl/docs.tar.gz
Binary file not shown.
Loading

0 comments on commit 772d703

Please sign in to comment.