NAME
Bio::SeqIO::seqxml - SeqXML sequence input/output stream
SYNOPSIS
# Do not use this module directly. Use it via the Bio::SeqIO class.use Bio::SeqIO;# read a SeqXML filemy $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>.
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.
This module is based in part (particularly the XML-parsing part) on Bio::TreeIO::phyloxml by Mira Han.
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.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
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
AUTHORS - Dave Messina
Email: [email protected]
CONTRIBUTORS
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
_initialize
Title : _initializeUsage : $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 usedwhen writing out a seqxml file. They are all optional.Returns : noneArgs : -source => source string (usually a database name)-sourceVersion => source version. The version number of the source-seqXMLversion => the version of seqXML that will be usedThrows : Exception if XML::LibXML::Reader or XML::Writeris not initialized
next_seq
Title : next_seqUsage : $seq = $stream->next_seq()Function: returns the next sequence in the streamReturns : L<Bio::Seq> object, or nothing if no more availableArgs : none
write_seq
Title : write_seqUsage : $stream->write_seq(@seq)Function: Writes the $seq object into the streamReturns : 1 for success and 0 for errorArgs : Array of 1 or more L<Bio::PrimarySeqI> objects
_initialize_seqxml_node_methods
Title : _initialize_seqxml_node_methodsUsage : $self->_initialize_xml_node_methodsFunction: sets up code ref mapping of each seqXML node typeto a method for processing that node typeReturns : noneArgs : none
schemaLocation
Title : schemaLocationUsage : $self->schemaLocationFunction: gets/sets the schema location in the <seqXML> headerReturns : the schema location stringArgs : To set the schemaLocation, call with a schemaLocation as the argument.
source
Title : sourceUsage : $self->sourceFunction: gets/sets the data source in the <seqXML> headerReturns : the data source stringArgs : To set the source, call with a source string as the argument.
sourceVersion
Title : sourceVersionUsage : $self->sourceVersionFunction: gets/sets the data source version in the <seqXML> headerReturns : the data source version stringArgs : To set the source version, call with a source version stringas the argument.
seqXMLversion
Title : seqXMLversionUsage : $self->seqXMLversionFunction: gets/sets the seqXML version in the <seqXML> headerReturns : the seqXML version string.Args : To set the seqXML version, call with a seqXML version stringas the argument.
Methods for parsing the XML document
processXMLNode
Title : processXMLNodeUsage : $seqio->processXMLNodeFunction: reads the XML node and processes according to the node typeReturns : noneArgs : noneThrows : Exception on unexpected XML node type, warnings on unexpectedXML element names.
processAttribute
Title : processAttributeUsage : $seqio->processAttribute(\%hash_for_attribute);Function: reads the attributes of the current element into a hashReturns : noneArgs : hash reference where the attributes will be stored.
parseHeader
Title : parseHeaderUsage : $self->parseHeader();Function: reads the opening <seqXML> block and grabs the metadata from it,namely the source, sourceVersion, and seqXMLversion.Returns : noneArgs : noneThrows : Exception if it hits an <entry> tag, because that means it'smissed the <seqXML> tag and read too far into the file.
element_seqXML
Title : element_seqXMLUsage : $self->element_seqXMLFunction: processes the opening <seqXML> nodeReturns : noneArgs : none
element_entry
Title : element_entryUsage : $self->element_entryFunction: processes a sequence <entry> nodeReturns : noneArgs : noneThrows : Exception if sequence ID is not present in <entry> element
element_species
Title : element_entryUsage : $self->element_entryFunction: processes a <species> node, creating a Bio::Species objectReturns : noneArgs : noneThrows : Exception if <species> tag exists but is empty,or if the attributes 'name' or 'ncbiTaxID' are undefined
element_description
Title : element_descriptionUsage : $self->element_descriptionFunction: processes a sequence <description> node;a no-op -- description text is read byprocessXMLnodeReturns : noneArgs : none
element_RNAseq
Title : element_RNAseqUsage : $self->element_RNAseqFunction: processes a sequence <RNAseq> nodeReturns : noneArgs : none
element_DNAseq
Title : element_DNAseqUsage : $self->element_DNAseqFunction: processes a sequence <DNAseq> nodeReturns : noneArgs : none
element_AAseq
Title : element_AAseqUsage : $self->element_AAseqFunction: processes a sequence <AAseq> nodeReturns : noneArgs : none
element_DBRef
Title : element_DBRefUsage : $self->element_DBRefFunction: processes a sequence <DBRef> node,creating a Bio::Annotation::DBLink objectReturns : noneArgs : none
element_property
Title : element_propertyUsage : $self->element_propertyFunction: processes a sequence <property> node, creating aBio::Annotation::SimpleValue objectReturns : noneArgs : none
end_element_RNAseq
Title : end_element_RNAseqUsage : $self->end_element_RNAseqFunction: processes a sequence <RNAseq> nodeReturns : noneArgs : none
end_element_DNAseq
Title : end_element_DNAseqUsage : $self->end_element_DNAseqFunction: processes a sequence <DNAseq> nodeReturns : noneArgs : none
end_element_AAseq
Title : end_element_AAseqUsage : $self->end_element_AAseqFunction: processes a sequence <AAseq> nodeReturns : noneArgs : none
end_element_entry
Title : end_element_entryUsage : $self->end_element_entryFunction: processes the closing </entry> node, creating the Seq objectReturns : a Bio::Seq objectArgs : noneThrows : Exception if sequence, sequence ID, or alphabet are missing
end_element_default
Title : end_element_defaultUsage : $self->end_element_defaultFunction: processes all other closing tags;a no-op.Returns : noneArgs : none
DESTROY
Title : DESTROYUsage : called automatically by Perl just before objectgoes out of scopeFunction: performs a write flushReturns : noneArgs : none
close
Title : closeUsage : $seqio_obj->close().Function: writes closing </seqXML> tag.close() will be called automatically by Perl when yourprogram exits, but if you want to use the seqXML fileyou've written before then, you'll need to do an explicitclose first to get the final </seqXML> tag.Returns : noneArgs : none