Skip to content
Snippets Groups Projects
Commit 8a606c46 authored by Daniel Rios's avatar Daniel Rios
Browse files

modified to add proper coverage for negative strand

parent 27cb009b
No related branches found
No related tags found
No related merge requests found
......@@ -273,6 +273,10 @@ sub _add_coverage_information{
my $rc_adaptor = $variation_db->get_ReadCoverageAdaptor();
my $rcs = $rc_adaptor->fetch_all_by_Slice_Sample_depth($self,$self->{'_strain'},1);
my $rcs_sorted;
@{$rcs_sorted} = sort {$a->start <=> $b->start} @{$rcs} if ($self->strand == -1);
$rcs = $rcs_sorted if ($self->strand == -1);
$$reference_sequence = reverse($$reference_sequence) if ($self->strand == -1);
my $start = 0;
foreach my $rc (@{$rcs}){
$rc->start(1) if ($rc->start < 0); #if the region lies outside the boundaries of the slice
......@@ -281,6 +285,7 @@ sub _add_coverage_information{
$start = $rc->end - 1;
}
substr($$reference_sequence, $start, ($self->length - $start) ,'~' x ($self->length - $start)) if ($self->length -1 > $start);
$$reference_sequence = reverse($$reference_sequence) if ($self->strand == -1);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment