Back to index

python-biopython  1.60
Classes | Functions | Variables
Bio.PDB.Polypeptide Namespace Reference

Classes

class  Polypeptide
class  _PPBuilder
class  CaPPBuilder
class  PPBuilder

Functions

def index_to_one
def one_to_index
def index_to_three
def three_to_index
def three_to_one
def one_to_three
def is_aa

Variables

list standard_aa_names
string aa1 = "ACDEFGHIKLMNPQRSTVWY"
 aa3 = standard_aa_names
dictionary d1_to_index = {}
dictionary dindex_to_1 = {}
dictionary d3_to_index = {}
dictionary dindex_to_3 = {}
list n1 = aa1[i]
list n3 = aa3[i]
tuple p = PDBParser(PERMISSIVE=True)
tuple s = p.get_structure("scr", sys.argv[1])
tuple ppb = PPBuilder()

Function Documentation

Index to corresponding one letter amino acid name.

>>> index_to_one(0)
'A'
>>> index_to_one(19)
'Y'

Definition at line 83 of file Polypeptide.py.

00083 
00084 def index_to_one(index):
00085     """Index to corresponding one letter amino acid name.
00086     
00087     >>> index_to_one(0)
00088     'A'
00089     >>> index_to_one(19)
00090     'Y'
00091     """
00092     return dindex_to_1[index]

Index to corresponding three letter amino acid name.

>>> index_to_three(0)
'ALA'
>>> index_to_three(19)
'TYR'

Definition at line 103 of file Polypeptide.py.

00103 
00104 def index_to_three(i):
00105     """Index to corresponding three letter amino acid name.
00106     
00107     >>> index_to_three(0)
00108     'ALA'
00109     >>> index_to_three(19)
00110     'TYR'
00111     """
00112     return dindex_to_3[i]

def Bio.PDB.Polypeptide.is_aa (   residue,
  standard = False 
)
Return True if residue object/string is an amino acid.

@param residue: a L{Residue} object OR a three letter amino acid code
@type residue: L{Residue} or string

@param standard: flag to check for the 20 AA (default false) 
@type standard: boolean

>>> is_aa('ALA')
True

Known three letter codes for modified amino acids are supported,

>>> is_aa('FME')
True
>>> is_aa('FME', standard=True)
False

Definition at line 152 of file Polypeptide.py.

00152 
00153 def is_aa(residue, standard=False):
00154     """Return True if residue object/string is an amino acid.
00155 
00156     @param residue: a L{Residue} object OR a three letter amino acid code
00157     @type residue: L{Residue} or string
00158 
00159     @param standard: flag to check for the 20 AA (default false) 
00160     @type standard: boolean
00161 
00162     >>> is_aa('ALA')
00163     True
00164 
00165     Known three letter codes for modified amino acids are supported,
00166 
00167     >>> is_aa('FME')
00168     True
00169     >>> is_aa('FME', standard=True)
00170     False
00171     """
00172     #TODO - What about special cases like XXX, can they appear in PDB files?
00173     if not isinstance(residue, basestring):
00174         residue=residue.get_resname()
00175     residue=residue.upper()
00176     if standard:
00177         return residue in d3_to_index
00178     else:
00179         return residue in to_one_letter_code
00180 

Here is the caller graph for this function:

One letter code to index.

>>> one_to_index('A')
0
>>> one_to_index('Y')
19

Definition at line 93 of file Polypeptide.py.

00093 
00094 def one_to_index(s):
00095     """One letter code to index.
00096     
00097     >>> one_to_index('A')
00098     0
00099     >>> one_to_index('Y')
00100     19
00101     """
00102     return d1_to_index[s]

One letter code to three letter code.

>>> one_to_three('A')
'ALA'
>>> one_to_three('Y')
'TYR'

Definition at line 141 of file Polypeptide.py.

00141 
00142 def one_to_three(s):
00143     """One letter code to three letter code.
00144     
00145     >>> one_to_three('A')
00146     'ALA'
00147     >>> one_to_three('Y')
00148     'TYR'
00149     """
00150     i=d1_to_index[s]
00151     return dindex_to_3[i]

Three letter code to index.

>>> three_to_index('ALA')
0
>>> three_to_index('TYR')
19

Definition at line 113 of file Polypeptide.py.

00113 
00114 def three_to_index(s):
00115     """Three letter code to index.
00116     
00117     >>> three_to_index('ALA')
00118     0
00119     >>> three_to_index('TYR')
00120     19
00121     """
00122     return d3_to_index[s]

Three letter code to one letter code.

>>> three_to_one('ALA')
'A'
>>> three_to_one('TYR')
'Y'

For non-standard amino acids, you get a KeyError:

>>> three_to_one('MSE')
Traceback (most recent call last):
   ...
KeyError: 'MSE'

Definition at line 123 of file Polypeptide.py.

00123 
00124 def three_to_one(s):
00125     """Three letter code to one letter code.
00126     
00127     >>> three_to_one('ALA')
00128     'A'
00129     >>> three_to_one('TYR')
00130     'Y'
00131 
00132     For non-standard amino acids, you get a KeyError:
00133 
00134     >>> three_to_one('MSE')
00135     Traceback (most recent call last):
00136        ...
00137     KeyError: 'MSE'
00138     """
00139     i=d3_to_index[s]
00140     return dindex_to_1[i]


Variable Documentation

string Bio.PDB.Polypeptide.aa1 = "ACDEFGHIKLMNPQRSTVWY"

Definition at line 66 of file Polypeptide.py.

Definition at line 67 of file Polypeptide.py.

Definition at line 69 of file Polypeptide.py.

Definition at line 71 of file Polypeptide.py.

Definition at line 70 of file Polypeptide.py.

Definition at line 72 of file Polypeptide.py.

Definition at line 76 of file Polypeptide.py.

Definition at line 77 of file Polypeptide.py.

tuple Bio.PDB.Polypeptide.p = PDBParser(PERMISSIVE=True)

Definition at line 450 of file Polypeptide.py.

Definition at line 454 of file Polypeptide.py.

tuple Bio.PDB.Polypeptide.s = p.get_structure("scr", sys.argv[1])

Definition at line 452 of file Polypeptide.py.

Initial value:
00001 ["ALA", "CYS", "ASP", "GLU", "PHE", "GLY", "HIS", "ILE", "LYS", 
00002                    "LEU", "MET", "ASN", "PRO", "GLN", "ARG", "SER", "THR", "VAL",
00003                    "TRP", "TYR"]

Definition at line 61 of file Polypeptide.py.