Skip to content

Commit 9033c8e

Browse files
committed
resurrect get_read_span()
1 parent 784eeec commit 9033c8e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

SAM_entry.pm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,25 @@ sub get_genome_span {
148148
return($min_coord, $max_coord);
149149
}
150150

151+
####
152+
sub get_read_span {
153+
my $self = shift;
154+
155+
my ($genome_aref, $read_aref) = $self->get_alignment_coords();
156+
157+
my @coords;
158+
foreach my $read_coordset (@$read_aref) {
159+
push (@coords, @$read_coordset);
160+
}
161+
162+
@coords = sort {$a<=>$b} @coords;
163+
164+
my $min_coord = shift @coords;
165+
my $max_coord = pop @coords;
166+
167+
return($min_coord, $max_coord);
168+
169+
}
151170

152171
####
153172
sub get_alignment_length {

0 commit comments

Comments
 (0)