Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
* Use version 2.2.5 of the battenberg R package
* Removed R files from repository
  • Loading branch information
kathryn-beal committed May 9, 2017
2 parents cc6509a + 4ff0cbc commit da5937c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ 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

dist: trusty
sudo: false
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 3.0.0
* Use verion 2.2.5 of the battenberg R package
* Removed R files from repository
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ cgpBattenberg

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

[![Build Status](https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=master)](https://travis-ci.org/cancerit/cgpBattenberg) : master
[![Build Status](https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=master)](https://travis-ci.org/cancerit/cgpBattenberg) : master
[![Build Status](https://travis-ci.org/cancerit/cgpBattenberg.svg?branch=dev)](https://travis-ci.org/cancerit/cgpBattenberg) : dev

## Installation

The battenberg R files are not included in this repository. The perl wrapper supports battenberg v2.2.5 and this will be made publically available by the authors shortly. The last version of this repository to include the battenberg R files is 1.5.3

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

1. [PCAP-core v2.1.3+](https://github.com/ICGC-TCGA-PanCancer/PCAP-core/releases)
Expand Down
7 changes: 7 additions & 0 deletions perl/bin/battenberg.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
const my $DEFAULT_PROTOCOL => 'WGS';
const my $DEFAULT_PLATFORM => 'ILLUMINA';
const my $DEFAULT_SEED => 1488823153;
const my $DEFAULT_CALC_SEG_BAF_OPTION => 2; #Options are: 1 - median, 2 - mean.

const my $SPLIT_LOCI_ALL_GLOB => q{1000genomesloci2012_chr*_split*.txt};

Expand Down Expand Up @@ -190,6 +191,7 @@ sub setup {
'nc|noclean' => \$opts{'noclean'},
'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'},
) or pod2usage(2);

pod2usage(-verbose => 0, -exitval => 0) if(defined $opts{'h'});
Expand Down Expand Up @@ -394,7 +396,11 @@ sub setup {
$opts{'platform'} = $DEFAULT_PLATFORM if(!exists($opts{'platform'}) || !defined($opts{'platform'}));

$opts{'seed'} = $DEFAULT_SEED if(!exists($opts{'seed'}) || !defined($opts{'seed'}));
$opts{'calc_seg_baf_option'} = $DEFAULT_CALC_SEG_BAF_OPTION if(!exists($opts{'calc_seg_baf_option'}) || !defined($opts{'calc_seg_baf_option'}));

if ($opts{'calc_seg_baf_option'} < 1 || $opts{'calc_seg_baf_option'} > 2) {
die "ERROR: calc_seg_baf_option (" . $opts{'calc_seg_baf_option'} . ") can have values 1 (median) or 2 (mean)\n";
}
return \%opts;
}

Expand Down Expand Up @@ -450,6 +456,7 @@ =head1 SYNOPSIS
-genderloci -gl List of gender loci, required when '-ge L' [share/gender/GRCh37d5_Y.loci]
- these are loci that will not present at all in a female sample
-seed -se Integer value to be used as a seed for random number generation [1488823153]
-calc_seg_baf_option -sb Various options to recalculate the BAF of a segment. Options are: 1 - median, 2 - mean. (Default: 2)
Optional system related parameters:
-threads -t Number of threads allowed on this machine (default 1)
Expand Down
17 changes: 7 additions & 10 deletions perl/lib/Sanger/CGP/Battenberg/Implement.pm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ const my $SEGMENTATION_GAMMA => 10;
const my $PHASING_GAMMA => 1;
const my $KMIN => 3;
const my $PHASE_KMIN => 3;
const my $CALC_SEG_BAF_OPTION => 1;

#callsubclones
const my $SIGLEVEL => 0.05;
Expand Down Expand Up @@ -800,7 +799,7 @@ sub battenberg_segmentphased{
my $phasegamma = $PHASING_GAMMA;
my $kmin = $KMIN;
my $phasekmin = $PHASE_KMIN;
my $calc_seg_baf_option = $CALC_SEG_BAF_OPTION;
my $calc_seg_baf_option = $options->{'calc_seg_baf_option'};

my $command = "cd $tmp; ";
$command .= _which($RSCRIPT) || die "Unable to find $RSCRIPT in path";
Expand Down Expand Up @@ -855,13 +854,11 @@ sub battenberg_fitcopyno{
}
my $rho_psi_cmds = q{};
if (exists ($options->{'rho'}) && defined($options->{'rho'})){
#Sanity checks for psi and rho
#if ($options->{'rho'} < $options->{'min_rho'} || $options->{'rho'} > $options->{'max_rho'}) {
# die("Invalid value for rho (" . $options->{'rho'} . "). This should be in the range specified by min_rho (" . $options->{'min_rho'} . ") and max_rho (" . $options->{'max_rho'} . ")");
#}
#if ($options->{'psi'} < $options->{'min_ploidy'} || $options->{'psi'} > $options->{'max_ploidy'}) {
# die("Invalid value for ploidy (" . $options->{'psi'} . "). This should be in the range specified by min_ploidy (" . $options->{'min_ploidy'} . ") and max_ploidy (" . $options->{'max_ploidy'} . ")");
#}
#Sanity checks for rho only. Truncate to 5 decimal places for max comparison to allow for rounding issues
my $round_rho = sprintf("%.5f", $options->{'rho'});
if ($options->{'rho'} < $options->{'min_rho'} || $round_rho > $options->{'max_rho'}) {
die("Invalid value for rho (" . $round_rho . "). This should be in the range specified by min_rho (" . $options->{'min_rho'} . ") and max_rho (" . $options->{'max_rho'} . ")");
}
$rho_psi_cmds .= ', use_preset_rho_psi=T';
$rho_psi_cmds .= ', preset_rho='. $options->{'rho'};
$rho_psi_cmds .= ', preset_psi=' . $options->{'psi'};
Expand Down Expand Up @@ -966,7 +963,7 @@ sub battenberg_callsubclones{
my $siglevel = $SIGLEVEL;
my $maxdist = $MAXDIST;
my $noperms = $NOPERMS;
my $calc_seg_baf_option = $CALC_SEG_BAF_OPTION;
my $calc_seg_baf_option = $options->{'calc_seg_baf_option'};
my $seed = $options->{'seed'};

my $command = "cd $tmp; ";
Expand Down

0 comments on commit da5937c

Please sign in to comment.