Permalink
Browse files

allow looping ranges for circular genomes. See Re: [Gmod-ajax] flatfi…

…le-to-json.pl error with GFF
  • Loading branch information...
1 parent 5891306 commit d752a4cb5168d1bb01f8c80247a57f66b2bd9daf @cmungall cmungall committed Jul 27, 2010
Showing with 15 additions and 4 deletions.
  1. +15 −4 Bio/SeqFeature/Tools/Unflattener.pm
@@ -1123,6 +1123,9 @@ sub unflatten_seq{
# seq we want to unflatten
$seq = $seq || $self->seq;
+ if (!$self->seq) {
+ $self->seq($seq);
+ }
# prevent bad argument combinations
@@ -2837,10 +2840,18 @@ sub _check_order_is_consistent {
my $rangeP = $ranges[$i-1];
my $range = $ranges[$i];
if ($rangeP->start > $range->end) {
- # failed - but still get one more chance..
- $pass = 0;
- $self->problem(2,"Ranges not in correct order. Strange ensembl genbank entry? Range: $rangestr");
- last;
+ if ($self->seq->is_circular) {
+ # see for example NC_006578.gbk
+ # we make exceptions for circular genomes here.
+ # see Re: [Gmod-ajax] flatfile-to-json.pl error with GFF
+ # 2010-07-26
+ }
+ else {
+ # failed - but still get one more chance..
+ $pass = 0;
+ $self->problem(2,"Ranges not in correct order. Strange ensembl genbank entry? Range: $rangestr");
+ last;
+ }
}
}

0 comments on commit d752a4c

Please sign in to comment.