Package Bio :: Package Phylo :: Module PhyloXML :: Class Sequence
[hide private]
[frames] | no frames]

Class Sequence

source code

          object --+        
                   |        
BaseTree.TreeElement --+    
                       |    
            PhyloElement --+
                           |
                          Sequence

A molecular sequence (Protein, DNA, RNA) associated with a node.

One intended use for 'id_ref' is to link a sequence to a taxonomy (via the taxonomy's 'id_source') in case of multiple sequences and taxonomies per node.

Instance Methods [hide private]
 
__init__(self, type=None, id_ref=None, id_source=None, symbol=None, accession=None, name=None, location=None, mol_seq=None, uri=None, domain_architecture=None, annotations=None, other=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
to_seqrecord(self)
Create a SeqRecord object from this Sequence instance.
source code
 
get_alphabet(self) source code

Inherited from BaseTree.TreeElement: __repr__, __str__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
from_seqrecord(cls, record, is_aligned=None)
Create a new PhyloXML Sequence from a SeqRecord object.
source code
Class Variables [hide private]
  alphabets = {'dna': DNAAlphabet(), 'protein': ProteinAlphabet(...
  re_symbol = re.compile(r'\S{1,10}')
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, type=None, id_ref=None, id_source=None, symbol=None, accession=None, name=None, location=None, mol_seq=None, uri=None, domain_architecture=None, annotations=None, other=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • type - type of sequence ('dna', 'rna', or 'protein').
  • symbol - short symbol of the sequence, e.g. 'ACTM' (max. 10 chars)
  • name - full name of the sequence, e.g. 'muscle Actin'
  • location - location of a sequence on a genome/chromosome.
  • annotations - list of Annotation objects
  • domain_architecture - protein domains on this sequence (type DomainArchitecture)
  • other - list of non-phyloXML elements (type Other)
Overrides: object.__init__
(inherited documentation)

to_seqrecord(self)

source code 

Create a SeqRecord object from this Sequence instance.

The seqrecord.annotations dictionary is packed like so:

   { # Sequence attributes with no SeqRecord equivalent:
     'id_ref':     self.id_ref,
     'id_source':  self.id_source,
     'location':   self.location,
     'uri':        { 'value': self.uri.value,
                     'desc': self.uri.desc,
                     'type': self.uri.type },
     # Sequence.annotations attribute (list of Annotations)
     'annotations': [{ 'ref':      ann.ref,
                       'source':   ann.source,
                       'evidence': ann.evidence,
                       'type':     ann.type,
                       'confidence': [ ann.confidence.value,
                                       ann.confidence.type ],
                       'properties': [{ 'value': prop.value,
                                        'ref': prop.ref,
                                        'applies_to': prop.applies_to,
                                        'datatype':   prop.datatype,
                                        'unit':       prop.unit,
                                        'id_ref':     prop.id_ref }
                                      for prop in ann.properties],
                     } for ann in self.annotations],
   }

Class Variable Details [hide private]

alphabets

Value:
{'dna': DNAAlphabet(),
 'protein': ProteinAlphabet(),
 'rna': RNAAlphabet()}