-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
74 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package Sanger::CGP::Pindel; | ||
|
||
########## LICENCE ########## | ||
# Copyright (c) 2014-2018 Genome Research Ltd. | ||
# Copyright (c) 2014-2019 Genome Research Ltd. | ||
# | ||
# Author: CASM/Cancer IT <[email protected]> | ||
# | ||
|
@@ -26,7 +26,7 @@ use strict; | |
use Const::Fast qw(const); | ||
|
||
use base 'Exporter'; | ||
our $VERSION = '3.0.6'; | ||
our $VERSION = '3.1.0'; | ||
our @EXPORT = qw($VERSION); | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package Sanger::CGP::Pindel::InputGen; | ||
|
||
########## LICENCE ########## | ||
# Copyright (c) 2014-2018 Genome Research Ltd. | ||
# Copyright (c) 2014-2019 Genome Research Ltd. | ||
# | ||
# Author: CASM/Cancer IT <[email protected]> | ||
# | ||
|
@@ -51,7 +51,7 @@ use Sanger::CGP::Pindel::InputGen::Pair; | |
|
||
const my $PAIRS_PER_THREAD => 500_000; | ||
|
||
const my $BAMCOLLATE => q{%s outputformat=sam colsbs=268435456 collate=1 classes=F,F2 exclude=DUP,SECONDARY,QCFAIL,SUPPLEMENTARY T=%s filename=%s reference=%s inputformat=%s}; | ||
const my $BAMCOLLATE => q{%s outputformat=sam colsbs=268435456 collate=1 classes=F,F2 exclude=DUP,SECONDARY,SUPPLEMENTARY T=%s filename=%s reference=%s inputformat=%s}; | ||
|
||
sub new { | ||
my ($class, $bam, $exclude, $ref) = @_; | ||
|
@@ -238,8 +238,7 @@ sub reads_to_pindel { | |
for(1..$total_pairs) { | ||
my $pair = Sanger::CGP::Pindel::InputGen::Pair->new(\shift @reads, \shift @reads, $tabix); | ||
next unless($pair->keep_pair); | ||
$to_pindel->set_pair($pair); | ||
push @records, @{$to_pindel->pair_to_pindel}; | ||
push @records, @{$to_pindel->pair_to_pindel($pair)}; | ||
|
||
} | ||
my $retained = scalar @records; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package Sanger::CGP::Pindel::InputGen::Pair; | ||
|
||
########## LICENCE ########## | ||
# Copyright (c) 2014-2018 Genome Research Ltd. | ||
# Copyright (c) 2014-2019 Genome Research Ltd. | ||
# | ||
# Author: CASM/Cancer IT <[email protected]> | ||
# | ||
|
@@ -57,6 +57,12 @@ sub unmapped_pair { | |
return 0; | ||
} | ||
|
||
sub qcfailed_pair { | ||
my $self = shift; | ||
return 1 if($self->{'r1'}->qc_failed && $self->{'r2'}->qc_failed); | ||
return 0; | ||
} | ||
|
||
sub has_good_anchor { | ||
my $self = shift; | ||
my $r2_state = $self->{'r2'}->good_anchor; # to ensure both fully populates | ||
|
@@ -73,6 +79,7 @@ sub has_good_query { | |
|
||
sub keep_pair { | ||
my $self = shift; | ||
return 0 if($self->qcfailed_pair); | ||
return 0 if($self->unmapped_pair); | ||
return 0 if($self->exact); | ||
return 0 unless($self->has_good_anchor); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package Sanger::CGP::Pindel::InputGen::PairToPindel; | ||
|
||
########## LICENCE ########## | ||
# Copyright (c) 2014-2018 Genome Research Ltd. | ||
# Copyright (c) 2014-2019 Genome Research Ltd. | ||
# | ||
# Author: CASM/Cancer IT <[email protected]> | ||
# | ||
|
@@ -55,14 +55,9 @@ sub setup_rg_inserts { | |
return 1; | ||
} | ||
|
||
sub set_pair { | ||
my ($self, $pair) = @_; | ||
croak "No pair provided" unless(defined $pair); | ||
$self->{'pair'} = $pair; | ||
} | ||
|
||
sub pair_to_pindel { | ||
my $self = shift; | ||
my ($self, $pair_in) = @_; | ||
$self->{'pair'} = $pair_in; | ||
my $r1 = $self->{'pair'}->{'r1'}; | ||
my $r2 = $self->{'pair'}->{'r2'}; | ||
my @pindel_records; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package Sanger::CGP::Pindel::InputGen::Read; | ||
|
||
########## LICENCE ########## | ||
# Copyright (c) 2014-2018 Genome Research Ltd. | ||
# Copyright (c) 2014-2019 Genome Research Ltd. | ||
# | ||
# Author: CASM/Cancer IT <[email protected]> | ||
# | ||
|
@@ -41,6 +41,7 @@ const my $UNMAPPED => 4; | |
const my $READ_REVERSED => 16; #0x0010 (set when reverse) | ||
const my $FIRST_IN_PAIR => 64; | ||
const my $SECOND_IN_PAIR => 128; | ||
const my $QC_FAIL => 512; | ||
|
||
const my $MIN_MAPQ => 0; | ||
const my $MIN_ANCHOR_MAPQ => 0; | ||
|
@@ -102,6 +103,11 @@ sub reversed { | |
(($self->{'flag'} | $READ_REVERSED) == $self->{'flag'}) ? 1 : 0; | ||
} | ||
|
||
sub qc_failed { | ||
my $self = shift; | ||
(($self->{'flag'} | $QC_FAIL) == $self->{'flag'}) ? 1 : 0; | ||
} | ||
|
||
sub strand { | ||
my $self = shift; | ||
$self->reversed ? '-' : '+'; | ||
|
@@ -191,6 +197,7 @@ sub good_query { | |
|
||
sub _good_query { | ||
my $self = shift; | ||
return 0 if($self->qc_failed); | ||
return 0 if(index($self->{'seq'},'NN') >= 0); | ||
return 0 if($self->frac_pbq_poor > $MAX_POOR_PBQ_FRAC); | ||
unless($self->unmapped) { | ||
|