diff --git a/Changes b/Changes index 54b623848..4db64076f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ LIST OF CHANGES FOR NPG-QC PACKAGE + - Fix in npg_qc::utils::bam_genotype for rare out of order mpileup failures - Travis CI build: when building dependencies, us the same branch as the one the pull request is made to. - back to testing with mysql 5.7.13 in travis diff --git a/lib/npg_qc/utils/bam_genotype.pm b/lib/npg_qc/utils/bam_genotype.pm index 16c6d5b6c..703f3d308 100755 --- a/lib/npg_qc/utils/bam_genotype.pm +++ b/lib/npg_qc/utils/bam_genotype.pm @@ -110,40 +110,6 @@ sub _build_samtools { return $self->samtools_name; } -has 'samtools_extract_regions' => ( - is => 'ro', - isa => 'NpgCommonResolvedPathExecutable', - lazy_build => 1, - coerce => 1, -); -sub _build_samtools_extract_regions { - my ($self) = @_; - return $self->samtools_name; -} - -has 'samtools_mpileup' => ( - is => 'ro', - isa => 'NpgCommonResolvedPathExecutable', - lazy_build => 1, - coerce => 1, -); -sub _build_samtools_mpileup { - my ($self) = @_; - return $self->samtools_name; -} - -has 'samtools_merge' => ( - is => 'ro', - isa => 'NpgCommonResolvedPathExecutable', - lazy_build => 1, - coerce => 1, -); -sub _build_samtools_merge { - my ($self) = @_; - return $self->samtools_name; -} - -# you can override the executable name. May be useful for variants like "samtools_irods" has 'bcftools_name' => ( is => 'ro', isa => 'Str', @@ -334,14 +300,14 @@ sub _build__call_gt_cmd { my $bam_file_list = $self->bam_file_list; if(@{$bam_file_list} == 1) { - $cmd = sprintf q{bash -c 'set -o pipefail && %s view -b %s %s 2>/dev/null | %s mpileup -l %s -f %s -g - 2>/dev/null | %s call -c -O v - 2>/dev/null'}, $self->samtools_extract_regions, $bam_file_list->[0], $self->_regions_string, $self->samtools_mpileup, $self->pos_snpname_map_filename, $self->reference, $self->bcftools; + $cmd = sprintf q{bash -c 'set -o pipefail && %s view -b %s %s 2>/dev/null | %s sort -l 0 - 2>/dev/null | %s mpileup -l %s -f %s -g - 2>/dev/null | %s call -c -O v - 2>/dev/null'}, $self->samtools, $bam_file_list->[0], $self->_regions_string, $self->samtools, $self->samtools, $self->pos_snpname_map_filename, $self->reference, $self->bcftools; } else { - $cmd = sprintf q{bash -c 'set -o pipefail && %s merge -- - }, $self->samtools_merge; + $cmd = sprintf q{bash -c 'set -o pipefail && %s merge -- - }, $self->samtools; for my $bam_file (@{$bam_file_list}) { - $cmd .= sprintf q{<(%s view -b %s %s) }, $self->samtools_extract_regions, $bam_file, $self->_regions_string; + $cmd .= sprintf q{<(%s view -b %s %s) }, $self->samtools, $bam_file, $self->_regions_string; } - $cmd .= sprintf q{ | %s mpileup -l %s -f %s -g - 2>/dev/null | %s call -c -O v - 2>/dev/null'}, $self->samtools_mpileup, $self->pos_snpname_map_filename, $self->reference, $self->bcftools; + $cmd .= sprintf q{ | %s mpileup -l %s -f %s -g - 2>/dev/null | %s call -c -O v - 2>/dev/null'}, $self->samtools, $self->pos_snpname_map_filename, $self->reference, $self->bcftools; } return $cmd;