Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tiny change to Bio::FeatureIO::gff to allow the gmod chado gff3 bulk …

…loader

to not choke when the gff file has ##sequence-region directives.  The loader
is documented not to support this, but now it will quitely ignore those
directives.
  • Loading branch information...
commit 2d8da6e5192c017e08b55ed36eabd1fa638cbc56 1 parent 1d680e7
@scottcain scottcain authored carandraug committed
Showing with 18 additions and 1 deletion.
  1. +18 −1 Bio/FeatureIO/gff.pm
View
19 Bio/FeatureIO/gff.pm
@@ -63,7 +63,7 @@ the web:
=head1 CONTRIBUTORS
Steffen Grossmann, <grossman@molgen.mpg.de>
- Scott Cain, <cain@cshl.edu>
+ Scott Cain, <scain@cpan.org>
Rob Edwards <rob@salmonella.org>
=head1 APPENDIX
@@ -104,6 +104,8 @@ sub _initialize {
$self->version( $arg{-version} || DEFAULT_VERSION);
$self->validate($arg{-validate_terms} || 0);
+ $self->ignore_seq_region($arg{-ignore_seq_region} || 0);
+
if ($arg{-file} =~ /^>.*/ ) {
$self->_print("##gff-version " . $self->version() . "\n");
}
@@ -444,6 +446,19 @@ sub _buffer_feature {
}
+=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'};
+}
+
=head1 _handle_directive()
this method is called for lines beginning with '##'.
@@ -468,6 +483,8 @@ sub _handle_directive {
# for these we want to store the seqid, start, and end. Then when we validate
# we want to make sure that the features are within the seqid/start/end
+ return if $self->ignore_seq_region();
+
$self->throw('Both start and end for sequence region should be defined')
unless $arg[1] && $arg[2];
my $fta = Bio::Annotation::OntologyTerm->new();
Please sign in to comment.
Something went wrong with that request. Please try again.