Browse files

fixed wrong interpretation of locations in bed files; added a test fi…

…le plus tests for this
  • Loading branch information...
1 parent 099d7ed commit c5b00a2e35df0dc7c9e524ebbff92b2f28bf0df2 pkensche committed with carandraug May 14, 2010
Showing with 3 additions and 2 deletions.
  1. +2 −2 Bio/FeatureIO/bed.pm
  2. +1 −0 t/data/1.bed
View
4 Bio/FeatureIO/bed.pm
@@ -228,8 +228,8 @@ sub next_feature {
return $self->next_feature;
}
- my $feature = Bio::SeqFeature::Annotated->new(-start => $start, # start is 0 based
- -end => --$end, # end is not part of the feature
+ my $feature = Bio::SeqFeature::Annotated->new(-start => ++$start, # start is 0 based; we need it 1-based
+ -end => $end, # end is one beyond the feature ends and thus already 1-based
$score ? (-score => $score) : (),
$strand ? (-strand => $strand eq '+' ? 1 : -1) : ());
View
1 t/data/1.bed
@@ -0,0 +1 @@
+chr1 0 10 test-coordinates-1

0 comments on commit c5b00a2

Please sign in to comment.