Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding test for ignore_seq_region method as well as a minor fix in Ge…

…nericFeatureHandler to deal with undef directives (ie, to ignore them).
  • Loading branch information...
commit ba33e24ad1b74988c67297c99b3905b828544a76 1 parent 51723af
@scottcain scottcain authored
View
1  lib/Bio/FeatureIO/Handler/GenericFeatureHandler.pm
@@ -159,6 +159,7 @@ sub seqfeature {
sub directives {
my ($handler, $data) = @_;
my $directive = $data->{DATA}->{type};
+ return unless $directive;
if ($directive eq 'sequence') {
my $fh = $handler->file_handle;
$handler->throw("Handler doesn't have a set file handle") if !$fh;
View
2  lib/Bio/FeatureIO/gff.pm
@@ -129,7 +129,7 @@ sub directive {
given ($directive) {
# validate here?
when ('sequence-region') {
- continue if $self->ignore_seq_region();
+ break if $self->ignore_seq_region();
@data{qw(type id start end)} =
('sequence-region', split(/\s+/, $rest));
}
View
12 t/gff3.t
@@ -247,6 +247,18 @@ is($fcount , 1); #sequence-region
################################################################################
#
+# use ignore_seq_region to skip sequence_region directives
+#
+
+ok( $io = Bio::FeatureIO->new(-file => test_input_file('directives.gff3'),
+ -ignore_seq_region => 1,
+ -verbose => test_debug()));
+
+is($io->next_feature(), undef);
+
+
+################################################################################
+#
# use FeatureIO::gff to read a GFF3 file as aggregated feature groups
#
Please sign in to comment.
Something went wrong with that request. Please try again.