Skip to content

Commit

Permalink
Merge branch 'hotfix/3.0.2'
Browse files Browse the repository at this point in the history
Moved call to create 1000genome loci filename hash to before use of threads to avoid glob bug in perl 5.16.3
  • Loading branch information
kathryn-beal committed Jun 12, 2017
2 parents 2bf3efd + 76dc2bf commit 0216f43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 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
* Bug fix when there are regions which have no copynumber values set which caused bb_vcf_to_ascat_cn.pl to crash

Expand Down
2 changes: 1 addition & 1 deletion perl/lib/Sanger/CGP/Battenberg.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use strict;

use Const::Fast qw(const);
use base 'Exporter';
our $VERSION = '3.0.1';
our $VERSION = '3.0.2';
our @EXPORT = qw($VERSION);

1;
Expand Down
16 changes: 9 additions & 7 deletions perl/lib/Sanger/CGP/Battenberg/Implement.pm
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ sub prepare {
$options->{'mod_path'} = get_mod_path();
$options->{'bat_path'} = File::Spec->catdir($options->{'mod_path'}, 'battenberg');
$options->{'tmp'} = File::Spec->rel2abs($options->{'tmp'});

$options->{'k_gen_loc'} = File::Spec->rel2abs($options->{'1kgenloc'});

#Get the appropriate loci file based on the index into the contigs array rather than the number
#of requested contigs. Need to set before using threads to avoid bug in perl 5.16.3
$options->{'loci_names_to_index'} = _lociNameMap($options->{'k_gen_loc'});

return 1;
}

Expand Down Expand Up @@ -337,16 +344,11 @@ sub battenberg_allelecount {
my ($chr) = $loci_file =~ /$SPLIT_LOCI_REGEX/;
$alleleCountOut = File::Spec->catfile($tmp, sprintf $SPLIT_ALLELE_COUNT_OUTPUT, $sample_name, $chr, $file_index);
} else {
my $k_gen_loc = File::Spec->rel2abs($options->{'1kgenloc'});

#Get the appropriate loci file based on the index into the contigs array rather than the number
#of requested contigs
my $loci_names_to_index = _lociNameMap($k_gen_loc);
my $contigs = read_contigs_from_file_with_ignore($options->{'reference'},$options->{'ignored_contigs'});
my $this_contig = $contigs->[$file_index-1];
my $file_index = $loci_names_to_index->{$this_contig};
my $file_index = $options->{'loci_names_to_index'}->{$this_contig};

$loci_file = File::Spec->catfile($k_gen_loc,sprintf($ALLELE_LOCI_NAME,$file_index));
$loci_file = File::Spec->catfile($options->{'k_gen_loc'},sprintf($ALLELE_LOCI_NAME,$file_index));
$alleleCountOut = File::Spec->rel2abs(File::Spec->catfile($tmp,sprintf($ALLELE_COUNT_OUTPUT,$sample_name,$file_index)));
}

Expand Down

0 comments on commit 0216f43

Please sign in to comment.