.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::SeqIO::seqxml 3pm" .TH Bio::SeqIO::seqxml 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::SeqIO::seqxml \- SeqXML sequence input/output stream .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # 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 => \*(Aqseqxml\*(Aq, \& \-file => \*(Aqmy_seqs.xml\*(Aq); \& \& while (my $seq_object = $seqio\->next_seq) { \& print join("\et", \& $seq_object\->display_id, \& $seq_object\->description, \& $seq_object\->seq, \& ), "\en"; \& } \& \& # write a SeqXML file \& # \& # Note that you can (optionally) specify the source \& # (usually a database) and source version. \& my $seqwriter = Bio::SeqIO\->new(\-format => \*(Aqseqxml\*(Aq, \& \-file => ">outfile.xml", \& \-source => \*(AqEnsembl\*(Aq, \& \-sourceVersion => \*(Aq56\*(Aq); \& $seqwriter\->write_seq($seq_object); \& \& # once you\*(Aqve written all of your seqs, you may want to do \& # an explicit close to get the closing tag \& $seqwriter\->close; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This object can transform Bio::Seq objects to and from SeqXML format. For more information on the SeqXML standard, visit . .PP In short, SeqXML is a lightweight sequence format that takes advantage of the validation capabilities of \s-1XML\s0 while not overburdening you with a strict and complicated schema. .PP This module is based in part (particularly the XML-parsing part) on Bio::TreeIO::phyloxml by Mira Han. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "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. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP 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. .SS "Reporting Bugs" .IX Subsection "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: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHORS \- Dave Messina" .IX Header "AUTHORS - Dave Messina" Email: \fIdmessina@cpan.org\fR .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "_initialize" .IX Subsection "_initialize" .Vb 3 \& 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::Reader or XML::Writer \& is not initialized .Ve .SS "next_seq" .IX Subsection "next_seq" .Vb 5 \& Title : next_seq \& Usage : $seq = $stream\->next_seq() \& Function: returns the next sequence in the stream \& Returns : L object, or nothing if no more available \& Args : none .Ve .SS "write_seq" .IX Subsection "write_seq" .Vb 5 \& Title : write_seq \& Usage : $stream\->write_seq(@seq) \& Function: Writes the $seq object into the stream \& Returns : 1 for success and 0 for error \& Args : Array of 1 or more L objects .Ve .SS "_initialize_seqxml_node_methods" .IX Subsection "_initialize_seqxml_node_methods" .Vb 6 \& 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 .Ve .SS "schemaLocation" .IX Subsection "schemaLocation" .Vb 5 \& Title : schemaLocation \& Usage : $self\->schemaLocation \& Function: gets/sets the schema location in the header \& Returns : the schema location string \& Args : To set the schemaLocation, call with a schemaLocation as the argument. .Ve .SS "source" .IX Subsection "source" .Vb 5 \& Title : source \& Usage : $self\->source \& Function: gets/sets the data source in the header \& Returns : the data source string \& Args : To set the source, call with a source string as the argument. .Ve .SS "sourceVersion" .IX Subsection "sourceVersion" .Vb 6 \& Title : sourceVersion \& Usage : $self\->sourceVersion \& Function: gets/sets the data source version in the header \& Returns : the data source version string \& Args : To set the source version, call with a source version string \& as the argument. .Ve .SS "seqXMLversion" .IX Subsection "seqXMLversion" .Vb 6 \& Title : seqXMLversion \& Usage : $self\->seqXMLversion \& Function: gets/sets the seqXML version in the header \& Returns : the seqXML version string. \& Args : To set the seqXML version, call with a seqXML version string \& as the argument. .Ve .SH "Methods for parsing the XML document" .IX Header "Methods for parsing the XML document" .SS "processXMLNode" .IX Subsection "processXMLNode" .Vb 7 \& 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. .Ve .SS "processAttribute" .IX Subsection "processAttribute" .Vb 5 \& Title : processAttribute \& Usage : $seqio\->processAttribute(\e%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. .Ve .SS "parseHeader" .IX Subsection "parseHeader" .Vb 8 \& Title : parseHeader \& Usage : $self\->parseHeader(); \& Function: reads the opening block and grabs the metadata from it, \& namely the source, sourceVersion, and seqXMLversion. \& Returns : none \& Args : none \& Throws : Exception if it hits an tag, because that means it\*(Aqs \& missed the tag and read too far into the file. .Ve .SS "element_seqXML" .IX Subsection "element_seqXML" .Vb 5 \& Title : element_seqXML \& Usage : $self\->element_seqXML \& Function: processes the opening node \& Returns : none \& Args : none .Ve .SS "element_entry" .IX Subsection "element_entry" .Vb 6 \& Title : element_entry \& Usage : $self\->element_entry \& Function: processes a sequence node \& Returns : none \& Args : none \& Throws : Exception if sequence ID is not present in element .Ve .SS "element_species" .IX Subsection "element_species" .Vb 7 \& Title : element_entry \& Usage : $self\->element_entry \& Function: processes a node, creating a Bio::Species object \& Returns : none \& Args : none \& Throws : Exception if tag exists but is empty, \& or if the attributes \*(Aqname\*(Aq or \*(AqncbiTaxID\*(Aq are undefined .Ve .SS "element_description" .IX Subsection "element_description" .Vb 7 \& Title : element_description \& Usage : $self\->element_description \& Function: processes a sequence node; \& a no\-op \-\- description text is read by \& processXMLnode \& Returns : none \& Args : none .Ve .SS "element_RNAseq" .IX Subsection "element_RNAseq" .Vb 5 \& Title : element_RNAseq \& Usage : $self\->element_RNAseq \& Function: processes a sequence node \& Returns : none \& Args : none .Ve .SS "element_DNAseq" .IX Subsection "element_DNAseq" .Vb 5 \& Title : element_DNAseq \& Usage : $self\->element_DNAseq \& Function: processes a sequence node \& Returns : none \& Args : none .Ve .SS "element_AAseq" .IX Subsection "element_AAseq" .Vb 5 \& Title : element_AAseq \& Usage : $self\->element_AAseq \& Function: processes a sequence node \& Returns : none \& Args : none .Ve .SS "element_DBRef" .IX Subsection "element_DBRef" .Vb 6 \& Title : element_DBRef \& Usage : $self\->element_DBRef \& Function: processes a sequence node, \& creating a Bio::Annotation::DBLink object \& Returns : none \& Args : none .Ve .SS "element_property" .IX Subsection "element_property" .Vb 6 \& Title : element_property \& Usage : $self\->element_property \& Function: processes a sequence node, creating a \& Bio::Annotation::SimpleValue object \& Returns : none \& Args : none .Ve .SS "end_element_RNAseq" .IX Subsection "end_element_RNAseq" .Vb 5 \& Title : end_element_RNAseq \& Usage : $self\->end_element_RNAseq \& Function: processes a sequence node \& Returns : none \& Args : none .Ve .SS "end_element_DNAseq" .IX Subsection "end_element_DNAseq" .Vb 5 \& Title : end_element_DNAseq \& Usage : $self\->end_element_DNAseq \& Function: processes a sequence node \& Returns : none \& Args : none .Ve .SS "end_element_AAseq" .IX Subsection "end_element_AAseq" .Vb 5 \& Title : end_element_AAseq \& Usage : $self\->end_element_AAseq \& Function: processes a sequence node \& Returns : none \& Args : none .Ve .SS "end_element_entry" .IX Subsection "end_element_entry" .Vb 6 \& Title : end_element_entry \& Usage : $self\->end_element_entry \& Function: processes the closing node, creating the Seq object \& Returns : a Bio::Seq object \& Args : none \& Throws : Exception if sequence, sequence ID, or alphabet are missing .Ve .SS "end_element_default" .IX Subsection "end_element_default" .Vb 6 \& Title : end_element_default \& Usage : $self\->end_element_default \& Function: processes all other closing tags; \& a no\-op. \& Returns : none \& Args : none .Ve .SS "\s-1DESTROY\s0" .IX Subsection "DESTROY" .Vb 6 \& Title : DESTROY \& Usage : called automatically by Perl just before object \& goes out of scope \& Function: performs a write flush \& Returns : none \& Args : none .Ve .SS "close" .IX Subsection "close" .Vb 3 \& Title : close \& Usage : $seqio_obj\->close(). \& Function: writes closing tag. \& \& close() will be called automatically by Perl when your \& program exits, but if you want to use the seqXML file \& you\*(Aqve written before then, you\*(Aqll need to do an explicit \& close first to get the final tag. \& Returns : none \& Args : none .Ve