Bio::S...driver(3pm)
β¨ NAME β¨
okay so this is Bio::SeqIO::gbdriver β a GenBank handler-based push parser π and yes it's the Bio::S...driver(3pm) page, the title got truncated but bestie it's this one, we know her π
πΈ SYNOPSIS πΈ
#It is probably best not to use this object directly, but
#rather go through the SeqIO handler:
$stream = Bio::SeqIO->new(-file => $filename,
-format => 'gbdriver');
while ( my $seq = $stream->next_seq() ) {
# do something with $seq
}
no cap, do not use this object directly, go through the SeqIO handler like a civilized icon π
π¦ DESCRIPTION π¦
So this object can transform Bio::Seq objects to and from GenBank flat file databases β¨ The key difference between this parser and the tried-and-true Bio::SeqIO::genbank parser is that this version splits the parsing and the data manipulation into two separate things: a 'driver' method (next_seq) and separate object handlers that deal with the data passed to them. it's giving separation of concerns, we love to see it π«Ά
π The Driver π
The main purpose of the driver routine β in this case next_seq() β is to carve out the data into meaningful chunks which get passed along to the relevant handlers (see below π).
Each chunk of data has a NAME tag attached to it, similar to how XML parsing does it. That tag designates the type of data being passed (annotation type or seqfeature) and which handler to call for processing it.
For GenBank annotations, the data is divided up and passed along to handlers depending on whether it's tagged with a field name (i.e. LOCUS) and whether that field name represents 'primary' annotation β in this case, meaning it's present at the beginning of the line, like REFERENCE. If the field is primary, it gets assigned to the NAME tag. Field names which aren't primary (they have at least 2 spaces before the name, like ORGANISM) get appended to the preceding primary field name as additional tags. ok so the indentation literally is the hierarchy, iykyk π
For feature table data, each new feature name signals the beginning of a new chunk of data. FEATURES is attached to NAME, the feature key (CDS, gene, etc) is attached as the PRIMARY_ID, and the location gets assigned to its own tag name (LOCATION). Feature qualifiers are added as additional keys, with multiple keys included in an array. β¨
Once a particular event occurs (new primary tag, sequence, end of record), the data is passed along to be processed by a handler or β if no handler is defined β tossed away ποΈ bestie it is just GONE.
Internally, the hash ref for a representative annotation (here a REFERENCE) looks like this:
$VAR1 = {
'JOURNAL' => 'Unpublished (2003)',
'TITLE' => 'The DNA sequence of Homo sapiens',
'NAME' => 'REFERENCE',
'REFERENCE' => '1 (bases 1 to 10001)',
'AUTHORS' => 'International Human Genome Sequencing Consortium.'
};
and a SeqFeature as this:
$VAR1 = {
'db_xref' => [
'GeneID:127086',
'InterimID:127086'
],
'LOCATION' => 'complement(3024..6641)',
'NAME' => 'FEATURES',
'FEATURE_KEY' => 'gene',
'gene' => 'LOC127086',
'note' => 'Derived by automated computational analysis using
gene prediction method: GNOMON.'
};
Note that any driver implementation would suffice as long as it fulfilled the requirements above π periodt.
π FEEDBACK π
π¬ Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules π§ send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated, fr fr π«Ά
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π« Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly π Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible π
π Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
π AUTHOR - Bioperl Project π
bioperl-l at bioperl.org
Original author Elia Stupka, elia -at- tigem.it
π CONTRIBUTORS π
Ewan Birney birney at ebi.ac.uk Jason Stajich jason at bioperl.org Chris Mungall cjm at fruitfly.bdgp.berkeley.edu Lincoln Stein lstein at cshl.org Heikki Lehvaslaiho, heikki at ebi.ac.uk Hilmar Lapp, hlapp at gmx.net Donald G. Jackson, donald.jackson at bms.com James Wasmuth, james.wasmuth at ed.ac.uk Brian Osborne, bosborne at alum.mit.edu
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ π
π next_seq
Title : next_seq
Usage : $seq = $stream->next_seq()
Function: returns the next sequence in the stream
Returns : Bio::Seq object
Args :
π write_seq
Title : write_seq
Usage : $stream->write_seq($seq)
Function: writes the $seq object (must be seq) to the stream
Returns : 1 for success and 0 for error
Args : array of 1 to n Bio::SeqI objects
π seqhandler
Title : seqhandler
Usage : $stream->seqhandler($handler)
Function: Get/Set the Bio::Seq::HandlerBaseI object
Returns : Bio::Seq::HandlerBaseI
Args : Bio::Seq::HandlerBaseI
that's the whole page bestie, no skips no cap π ok and before you go β this was perl v5.32.1, dated 2021-08-15, from Bio::S...driver(3pm) (User Contributed Perl Documentation, slay). go parse some GenBank, you've got this πβ¨π¦
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms