Permalink
Browse files

Add patch from Florian Finkernagel to accomodate paired end data that…

… are encoded as CIGAR strings.
  • Loading branch information...
1 parent a6e53d8 commit e4cc015bca3114a1fbbf3091fdf91fe71304cfd4 @lstein lstein committed Jan 13, 2012
Showing with 27 additions and 10 deletions.
  1. +4 −0 Bio-SamTools/Changes
  2. +2 −2 Bio-SamTools/META.yml
  3. +21 −8 Bio-SamTools/lib/Bio/DB/Sam.pm
View
@@ -1,3 +1,7 @@
+Version 1.34
+ * Add patch from Florian Finkernagel to accomodate paired end data that are
+ encoded as CIGAR strings.
+
Version 1.33
* Fix compile error on perl 5.8.7 and lower.
* Fix "substr outside of string" errors when processing split alignments with a hard clip
View
@@ -46,7 +46,7 @@ provides:
version: 0
Bio::DB::Sam:
file: lib/Bio/DB/Sam.pm
- version: 1.32
+ version: 1.33
Bio::DB::Sam::Constants:
file: lib/Bio/DB/Sam/Constants.pm
version: 0
@@ -70,4 +70,4 @@ requires:
perl: 5.008
resources:
license: http://dev.perl.org/licenses/
-version: 1.32
+version: 1.33
@@ -1949,12 +1949,12 @@ sub _build_mates {
my %read_pairs;
for my $a (@$src) {
- my $name = $a->display_name;
- unless ($read_pairs{$name}) {
- my $isize = $a->isize;
- my $start = $isize >= 0 ? $a->start : $a->end+$isize+1;
- my $end = $isize <= 0 ? $a->end : $a->start+$isize-1;
- $read_pairs{$name} =
+ my $name = $a->display_name;
+ unless ($read_pairs{$name}) {
+ my $isize = $a->isize;
+ my $start = $isize >= 0 ? $a->start : $a->end+$isize+1;
+ my $end = $isize <= 0 ? $a->end : $a->start+$isize-1;
+ $read_pairs{$name} =
Bio::SeqFeature::Lite->new(
-display_name => $name,
-seq_id => $a->seq_id,
@@ -1963,8 +1963,21 @@ sub _build_mates {
-type => 'read_pair',
-class => 'read_pair',
);
- }
- $read_pairs{$name}->add_SeqFeature($a);
+ }
+ my $d = $self->{split_splices};
+ if ($d) {
+ my @parts = $a->get_SeqFeatures;
+ if (!@parts) {
+ $read_pairs{$name}->add_SeqFeature($a);
+ }
+ else {
+ for my $x (@parts){
+ $read_pairs{$name}->add_SeqFeature($x);
+ }
+ }
+ } else {
+ $read_pairs{$name}->add_SeqFeature($a);
+ }
}
for my $name (keys %read_pairs) {
my $f = $read_pairs{$name};

0 comments on commit e4cc015

Please sign in to comment.