Bio.SeqIO.SeqXmlIO module

Bio.SeqIO support for the “seqxml” file format, SeqXML.

This module is for reading and writing SeqXML format files as SeqRecord objects, and is expected to be used via the Bio.SeqIO API.

SeqXML is a lightweight XML format which is supposed be an alternative for FASTA files. For more Information see http://www.seqXML.org and Schmitt et al (2011), https://doi.org/10.1093/bib/bbr025

class Bio.SeqIO.SeqXmlIO.XMLRecordIterator(handle, recordTag, namespace=None)

Bases: object

Base class for building iterators for record style XML formats.

It is assumed that all information for one record can be found within a record element or above. Two types of methods are called when the start tag of an element is reached. To receive only the attributes of an element before its end tag is reached implement _attr_TAGNAME. To get an element and its children as a DOM tree implement _elem_TAGNAME. Everything that is part of the DOM tree will not trigger any further method calls.

__init__(self, handle, recordTag, namespace=None)

Create the object and initializing the XML parser.

__iter__(self)

Iterate over the records in the XML file.

class Bio.SeqIO.SeqXmlIO.SeqXmlIterator(handle)

Bases: Bio.SeqIO.SeqXmlIO.XMLRecordIterator

Breaks seqXML file into SeqRecords.

Assumes valid seqXML please validate beforehand.

__init__(self, handle)

Create the object.

class Bio.SeqIO.SeqXmlIO.SeqXmlWriter(handle, source=None, source_version=None, species=None, ncbiTaxId=None)

Bases: Bio.SeqIO.Interfaces.SequentialSequenceWriter

Writes SeqRecords into seqXML file.

SeqXML requires the sequence alphabet be explicitly RNA, DNA or protein, i.e. an instance or subclass of Bio.Alphapet.RNAAlphabet, Bio.Alphapet.DNAAlphabet or Bio.Alphapet.ProteinAlphabet.

__init__(self, handle, source=None, source_version=None, species=None, ncbiTaxId=None)

Create Object and start the xml generator.

write_header(self)

Write root node with document metadata.

write_record(self, record)

Write one record.

Close the root node and finish the XML document.