Commit 223b441b authored by Eugene Kulesha's avatar Eugene Kulesha
Browse files

two bugs fixed: coverage regions of level 2 and above were skipped. coverage...

two bugs fixed: coverage regions of level 2 and above were skipped. coverage regions of 2bp and less caused the problems for web display
parent fd20ff65
......@@ -177,7 +177,7 @@ sub _filter_af_by_coverage{
my $rc_adaptor = $variation_db->get_ReadCoverageAdaptor();
#this is ugly, but ReadCoverage is always defined in the positive strand
my $rcs = $rc_adaptor->fetch_all_by_Slice_Sample_depth($self,$self->{'_strain'},1);
my $rcs = $rc_adaptor->fetch_all_by_Slice_Sample_depth($self,$self->{'_strain'});
my $new_af;
foreach my $af (@{$allele_features}){
foreach my $rc (@{$rcs}){
......@@ -299,7 +299,7 @@ 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 = $rc_adaptor->fetch_all_by_Slice_Sample_depth($self,$self->{'_strain'});
my $rcs_sorted;
@{$rcs_sorted} = sort {$a->start <=> $b->start} @{$rcs} if ($self->strand == -1);
$rcs = $rcs_sorted if ($self->strand == -1);
......@@ -307,8 +307,8 @@ sub _add_coverage_information{
foreach my $rc (@{$rcs}){
$rc->start(1) if ($rc->start < 0); #if the region lies outside the boundaries of the slice
$rc->end($self->end - $self->start + 1) if ($rc->end + $self->start > $self->end);
substr($$reference_sequence, $start,($rc->start - $start - 1),'~' x ($rc->start - $start - 1)) if ($rc->start - 1 > $start);
$start = $rc->end - 1;
substr($$reference_sequence, $start-1,($rc->start - $start - 1),'~' x ($rc->start - $start - 1)) if ($rc->start - 1 > $start);
$start = $rc->end ;
}
substr($$reference_sequence, $start, ($self->length - $start) ,'~' x ($self->length - $start)) if ($self->length -1 > $start);
}
......
Markdown is supported
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