Sequence

This module handles individual sequences.

class Sequence(*args)[source]

Handle individual sequences of an MSA object

Depending on input arguments, instances may point to an MSA object or store its own data:

MSA Pointer

An MSA instance and an index:

In [1]: from prody import *

In [2]: msa = parseMSA('piwi_seed.sth')
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-2-fce130cfb7ce> in <module>()
----> 1 msa = parseMSA('piwi_seed.sth')

/home/docs/checkouts/readthedocs.org/user_builds/prody/envs/v1.5/local/lib/python2.7/site-packages/prody/sequence/msafile.pyc in parseMSA(filename, **kwargs)
    483         if not fileok:
    484             raise IOError('[Errno 2] No such file or directory: ' +
--> 485                           repr(filename))
    486 
    487     # if MSA is a compressed file or filter/slice is passed, use

IOError: [Errno 2] No such file or directory: 'piwi_seed.sth'

In [3]: Sequence(msa, 0)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-8c5a985dfe08> in <module>()
----> 1 Sequence(msa, 0)

NameError: name 'msa' is not defined

In [4]: msa[0]
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-ac8524cb1326> in <module>()
----> 1 msa[0]

NameError: name 'msa' is not defined

Independent

Instantiation with sequence and label (optional) string:

In [5]: Sequence('SOME-SEQUENCE-STRING', 'MySeq/1-18')
 Out[5]: <Sequence: MySeq (length 20; 18 residues and 2 gaps)>
copy()[source]

Return a copy of the instance that owns its sequence data.

getIndex()[source]

Return sequence index or None.

getLabel(full=False)[source]

Return label of the sequence.

getMSA()[source]

Return MSA instance or None.

getResnums(gaps=False)[source]

Return list of residue numbers associated with non-gapped seq. When gaps is True, return a list containing the residue numbers with gaps appearing as None. Residue numbers are inferred from the full label. When label does not contain residue number information, indices a range of numbers starting from 1 is returned.

numGaps()[source]

Return number of gap characters.

numResidues()[source]

Return the number of alphabet characters.

Read the Docs v: v1.5
Versions
latest
v1.5
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.