Bio::F...IO::gff(3pm)
π NAME π
Bio::F...IO::gff β bestie, this is the module that reads and writes GFF feature files. That's it, that's the whole job. (It lives in the User Contributed Perl Documentation corner of the manual, and yes the full name on the tin is Bio::F...IO::gff(3pm), we're just being casual about it.) π¦
β¨ SYNOPSIS β¨
Okay so picture it: you've got a feature, you wanna spit it out as GFF. Say less:
my $feature; #get a Bio::SeqFeature::Annotated somehow
my $featureOut = Bio::FeatureIO->new(
-format => 'gff',
-version => 3,
-fh => \*STDOUT,
-validate_terms => 1, #boolean. validate ontology terms online? default 0 (false).
);
$featureOut->write_feature($feature);
That's the whole vibe. π
πΈ DESCRIPTION πΈ
Here's what's actually implemented right now, no cap:
- GFF 1 β read? N. write? N.
- GFF 2 β read? N. write? N.
- GFF 2.5 (GTF) β read? N. write? Y.
- GFF 3 β read? Y. write? Y. π
So like, GFF3 is the main character here, and GTF is the one that can only write. Everyone else is still getting ready. π
π«Ά FEEDBACK π«Ά
Mailing Lists
Your feedback is literally integral to the evolution of this and other Bioperl modules, and we want it. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated, fr fr.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_list - About the mailing lists
Support
Usage questions and support issues? Direct them to the mailing list:
bioperl-l@bioperl.org
...rather than to the module maintainer directly. There are so many experienced and reponsive experts who'll look at your problem and quickly address it. If at all possible, please include a thorough description of the problem with code and data examples. The more context, the more slay. π
Reporting Bugs
Report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolution. Bug reports can be submitted via the web:
http://bugzilla.open-bio.org/
π AUTHOR π
Allen Day, <allenday@ucla.edu>
π CONTRIBUTORS π
- Steffen Grossmann,
<grossman@molgen.mpg.de> - Scott Cain,
<cain@cshl.edu> - Rob Edwards
<rob@salmonella.org>
π§ APPENDIX π§
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _. (iykyk π)
next_feature()
- Usage:
my $feature = $featureio->next_feature(); - Function: reads a feature record from a GFF stream and returns it as an object.
- Returns: a Bio::SeqFeature::Annotated object
- Args: N/A
next_feature_group
- Title: next_feature_group
- Usage:
@feature_group = $stream->next_feature_group - Function: Reads the next feature_group from
$streamand returns it.
Feature groups in GFF3 files are separated by '###' directives. The features in a group might form a hierarchical structure. The complete hierarchy of features is returned, i.e. the returned array represents only the top-level features. Lower-level features can be accessed using the 'get_SeqFeatures' method recursively.
- Example:
# getting the complete hierarchy of features in a GFF3 file
my @toplevel_features;
while (my @fg = $stream->next_feature_group) {
push(@toplevel_features, @fg);
}
- Returns: an array of Bio::SeqFeature::Annotated objects
- Args: none
next_seq()
Access the FASTA section (if any) at the end of the GFF stream. π Note that this method will return undef if not all features in the stream have been handled. So like, finish your features first, bestie.
write_feature()
- Usage:
$featureio->write_feature( Bio::SeqFeature::Annotated->new(...) ); - Function: writes a feature in GFF format. the GFF version used is governed by the
'-version'argument passed toBio::FeatureIO->new(), and defaults to GFF version 3. - Returns:
###FIXME - Args: a Bio::SeqFeature::Annotated object.
β ACCESSORS β
fasta_mode()
- Usage:
$obj->fasta_mode($newval) - Function: (nothing here, bestie β it's blank in the original)
- Example: (also blank)
- Returns: value of fasta_mode (a scalar)
- Args: on set, new value (a scalar or undef, optional)
Side effect when setting: rewind the file handle a little bit to get the last carriage return that was swallowed when the previous line was processed. π
seqio()
- Usage:
$obj->seqio($newval) - Function: holds a Bio::SeqIO instance for handling the GFF3
##FASTAsection. - Returns: value of seqio (a scalar)
- Args: on set, new value (a scalar or undef, optional)
sequence_region()
- Usage: (blank)
- Function:
###FIXME - Returns: (blank)
- Args: (blank)
so()
- Usage:
$obj->so($newval) - Function: holds a Sequence Ontology instance
- Returns: value of so (a scalar)
- Args: on set, new value (a scalar or undef, optional)
validate()
- Usage:
$obj->validate($newval) - Function: true if encountered ontology terms in
next_feature()mode should be validated. - Returns: value of validate (a scalar)
- Args: on set, new value (a scalar or undef, optional)
version()
- Usage:
$obj->version($newval) - Function: version of GFF to read/write. valid values are
1,2,2.5, and3. - Returns: value of version (a scalar)
- Args: on set, new value (a scalar or undef, optional)
π INTERNAL METHODS π
_buffer_feature()
- Usage: (blank)
- Function:
###FIXME - Returns: (blank)
- Args: (blank)
_handle_directive()
This method is called for lines beginning with '##'.
_handle_feature()
This method is called for each line not beginning with '#'. it parses the line and returns a Bio::SeqFeature::Annotated object.
_handle_non_reserved_tag()
- Usage:
$self->_handle_non_reserved_tag($feature,$tag,$value) - Function: Deal with non-reserved word tags in the ninth column
- Returns: An updated Bio::SeqFeature::Annotated object
- Args: A Bio::SeqFeature::Annotated and a tag/value pair
Note that this method can be overridden in a subclass to provide special handling of non-reserved word tags. π
organism
Gets/sets the organims π (their spelling, not mine) from the organism directive.
_write_feature_1()
write a feature in GFF v1 format. currently not implemented.
_write_feature_2()
write a feature in GFF v2 format. currently not implemented.
_write_feature_25()
write a feature in GFF v2.5 (aka GTF) format.
_write_feature_3()
write a feature in GFF v3 format.
And that's a wrap, bestie!! π This whole page came to you courtesy of perl v5.30.0, dated 2020-01-13, from Bio::F...IO::gff(3pm). Go write some GFF, you icon. πβ¨
π¦ where this page comes from
- debian bookworm: libbio-featureio-perl 1.6.905-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-featureio-perl 1.6.905-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-featureio-perl 1.6.905-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-featureio-perl 1.6.905-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms