Permalink
Browse files

adding back in the ignore_ref_seq method; passes current tests, now h…

…ave to add a test for the new method
  • Loading branch information...
1 parent 3ec53e0 commit 51723af4b2a3d73bff937dc8de3e66f705690340 @scottcain scottcain committed Feb 15, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Bio/FeatureIO/gff.pm
View
@@ -15,6 +15,10 @@ use Bio::GFF3::LowLevel qw(
sub _initialize {
my ($self, @args) = @_;
$self->SUPER::_initialize(@args);
+
+ my %args = @args;
+ $self->ignore_seq_region($args{-ignore_seq_region} || 0);
+
my ($version) = $self->_rearrange([qw(VERSION)], @args);
$version ||= 3;
$self->version($version);
@@ -125,6 +129,7 @@ sub directive {
given ($directive) {
# validate here?
when ('sequence-region') {
+ continue if $self->ignore_seq_region();
@data{qw(type id start end)} =
('sequence-region', split(/\s+/, $rest));
}
@@ -144,6 +149,19 @@ sub directive {
\%data;
}
+=head1 ignore_seq_region
+
+Set this flag to keep FeatureIO from returning
+a feature for a ##sequence-region directive
+
+=cut
+
+sub ignore_seq_region {
+ my($self,$val) = @_;
+ $self->{'ignore_seq_region'} = $val if defined($val);
+ return $self->{'ignore_seq_region'};
+}
+
# TODO: this gets into the handler internals a bit too much, and I think the
# problem is orthogonal to the feature stream (in other words, maybe we simply
# pass features along and plugin(s) will help resolve feature groups)

0 comments on commit 51723af

Please sign in to comment.