Bio::S...seqxml(3pm)
π NAME π
Bio::SeqIO::seqxml β the SeqXML sequence input/output stream, bestie π (yes this is the Bio::S...seqxml(3pm) page, you're in the right place, dw)
β¨ SYNOPSIS β¨
okay so FIRST things first, and I need you to actually listen to me on this one:
π¨ Do not use this module directly. Use it via the Bio::SeqIO class. That's the vibe. That's the whole assignment.
# Do not use this module directly. Use it via the Bio::SeqIO class.
use Bio::SeqIO;
# read a SeqXML file
my $seqio = Bio::SeqIO->new(-format => 'seqxml',
-file => 'my_seqs.xml');
while (my $seq_object = $seqio->next_seq) {
print join("\t",
$seq_object->display_id,
$seq_object->description,
$seq_object->seq,
), "\n";
}
# write a SeqXML file
#
# Note that you can (optionally) specify the source
# (usually a database) and source version.
my $seqwriter = Bio::SeqIO->new(-format => 'seqxml',
-file => ">outfile.xml",
-source => 'Ensembl',
-sourceVersion => '56');
$seqwriter->write_seq($seq_object);
# once you've written all of your seqs, you may want to do
# an explicit close to get the closing </seqXML> tag
$seqwriter->close;
π¦ DESCRIPTION π¦
This object can transform Bio::Seq objects to and from SeqXML format. For more information on the SeqXML standard, visit http://www.seqxml.org.
okay so in short π«Ά β SeqXML is a lightweight sequence format that takes advantage of the validation capabilities of XML while not overburdening you with a strict and complicated schema. It's giving "the best of both worlds" and honestly? obsessed.
This module is based in part (particularly the XML-parsing part) on Bio::TreeIO::phyloxml by Mira Han. Shoutout π
π«Ά FEEDBACK π«Ά
π¬ Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules β like, genuinely, they want to hear from you. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is so appreciated, no cap.
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. There are so many experienced and responsive experts on there who will look at your problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible β the more context the better, fr fr.
π 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
π AUTHORS - Dave Messina π
Email: dmessina@cpan.org
πΈ CONTRIBUTORS πΈ
(nothing listed under here, bestie β just the heading and the vibe π )
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
_initialize
- Title:
_initialize - Usage:
$self->_initialize(@args) - Function: constructor (for internal use only).
Besides the usual SeqIO arguments (-file, -fh, etc.), Bio::SeqIO::seqxml accepts three arguments which are used when writing out a seqxml file. They are all optional.
- Returns: none
- Args:
-source=> source string (usually a database name)-sourceVersion=> source version. The version number of the source-seqXMLversion=> the version of seqXML that will be used
- Throws: Exception if
XML::LibXML::ReaderorXML::Writeris not initialized
next_seq
- Title:
next_seq - Usage:
$seq = $stream->next_seq() - Function: returns the next sequence in the stream
- Returns:
Bio::Seqobject, or nothing if no more available - Args: none
write_seq
- Title:
write_seq - Usage:
$stream->write_seq(@seq) - Function: Writes the
$seqobject into the stream - Returns: 1 for success and 0 for error
- Args: Array of 1 or more
Bio::PrimarySeqIobjects
_initialize_seqxml_node_methods
- Title:
_initialize_seqxml_node_methods - Usage:
$self->_initialize_xml_node_methods - Function: sets up code ref mapping of each seqXML node type to a method for processing that node type
- Returns: none
- Args: none
schemaLocation
- Title:
schemaLocation - Usage:
$self->schemaLocation - Function: gets/sets the schema location in the
<seqXML>header - Returns: the schema location string
- Args: To set the schemaLocation, call with a schemaLocation as the argument.
source
- Title:
source - Usage:
$self->source - Function: gets/sets the data source in the
<seqXML>header - Returns: the data source string
- Args: To set the source, call with a source string as the argument.
sourceVersion
- Title:
sourceVersion - Usage:
$self->sourceVersion - Function: gets/sets the data source version in the
<seqXML>header - Returns: the data source version string
- Args: To set the source version, call with a source version string as the argument.
seqXMLversion
- Title:
seqXMLversion - Usage:
$self->seqXMLversion - Function: gets/sets the seqXML version in the
<seqXML>header - Returns: the seqXML version string.
- Args: To set the seqXML version, call with a seqXML version string as the argument.
π Methods for parsing the XML document
processXMLNode
- Title:
processXMLNode - Usage:
$seqio->processXMLNode - Function: reads the XML node and processes according to the node type
- Returns: none
- Args: none
- Throws: Exception on unexpected XML node type, warnings on unexpected XML element names.
processAttribute
- Title:
processAttribute - Usage:
$seqio->processAttribute(\%hash_for_attribute); - Function: reads the attributes of the current element into a hash
- Returns: none
- Args: hash reference where the attributes will be stored.
parseHeader
- Title:
parseHeader - Usage:
$self->parseHeader(); - Function: reads the opening
<seqXML>block and grabs the metadata from it, namely the source, sourceVersion, and seqXMLversion. - Returns: none
- Args: none
- Throws: Exception if it hits an
<entry>tag, because that means it's missed the<seqXML>tag and read too far into the file.
element_seqXML
- Title:
element_seqXML - Usage:
$self->element_seqXML - Function: processes the opening
<seqXML>node - Returns: none
- Args: none
element_entry
- Title:
element_entry - Usage:
$self->element_entry - Function: processes a sequence
<entry>node - Returns: none
- Args: none
- Throws: Exception if sequence ID is not present in
<entry>element
element_species
- Title:
element_entry - Usage:
$self->element_entry - Function: processes a
<species>node, creating aBio::Speciesobject - Returns: none
- Args: none
- Throws: Exception if
<species>tag exists but is empty, or if the attributes 'name' or 'ncbiTaxID' are undefined
element_description
- Title:
element_description - Usage:
$self->element_description - Function: processes a sequence
<description>node; a no-op -- description text is read by processXMLnode - Returns: none
- Args: none
element_RNAseq
- Title:
element_RNAseq - Usage:
$self->element_RNAseq - Function: processes a sequence
<RNAseq>node - Returns: none
- Args: none
element_DNAseq
- Title:
element_DNAseq - Usage:
$self->element_DNAseq - Function: processes a sequence
<DNAseq>node - Returns: none
- Args: none
element_AAseq
- Title:
element_AAseq - Usage:
$self->element_AAseq - Function: processes a sequence
<AAseq>node - Returns: none
- Args: none
element_DBRef
- Title:
element_DBRef - Usage:
$self->element_DBRef - Function: processes a sequence
<DBRef>node, creating aBio::Annotation::DBLinkobject - Returns: none
- Args: none
element_property
- Title:
element_property - Usage:
$self->element_property - Function: processes a sequence
<property>node, creating aBio::Annotation::SimpleValueobject - Returns: none
- Args: none
end_element_RNAseq
- Title:
end_element_RNAseq - Usage:
$self->end_element_RNAseq - Function: processes a sequence
<RNAseq>node - Returns: none
- Args: none
end_element_DNAseq
- Title:
end_element_DNAseq - Usage:
$self->end_element_DNAseq - Function: processes a sequence
<DNAseq>node - Returns: none
- Args: none
end_element_AAseq
- Title:
end_element_AAseq - Usage:
$self->end_element_AAseq - Function: processes a sequence
<AAseq>node - Returns: none
- Args: none
end_element_entry
- Title:
end_element_entry - Usage:
$self->end_element_entry - Function: processes the closing
</entry>node, creating the Seq object - Returns: a
Bio::Seqobject - Args: none
- Throws: Exception if sequence, sequence ID, or alphabet are missing
end_element_default
- Title:
end_element_default - Usage:
$self->end_element_default - Function: processes all other closing tags; a no-op.
- Returns: none
- Args: none
DESTROY
- Title:
DESTROY - Usage: called automatically by Perl just before object goes out of scope
- Function: performs a write flush
- Returns: none
- Args: none
close
- Title:
close - Usage:
$seqio_obj->close(). - Function: writes closing
</seqXML>tag.
close() will be called automatically by Perl when your program exits, but if you want to use the seqXML file you've written before then, you'll need to do an explicit close first to get the final </seqXML> tag.
- Returns: none
- Args: none
and that's the whole page, bestie!! you ate that π β¨
signing off β this was perl v5.32.1, dated 2021-08-15, and you're welcome π
π¦ 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