Package Bio :: Package PDB :: Module Polypeptide
[hide private]
[frames] | no frames]

Module Polypeptide

source code

Polypeptide-related classes (construction and representation).

Simple example with multiple chains,

    >>> from Bio.PDB.PDBParser import PDBParser
    >>> from Bio.PDB.Polypeptide import PPBuilder
    >>> structure = PDBParser().get_structure('2BEG', 'PDB/2BEG.pdb')
    >>> ppb=PPBuilder()
    >>> for pp in ppb.build_peptides(structure):
    ...     print(pp.get_sequence())
    LVFFAEDVGSNKGAIIGLMVGGVVIA
    LVFFAEDVGSNKGAIIGLMVGGVVIA
    LVFFAEDVGSNKGAIIGLMVGGVVIA
    LVFFAEDVGSNKGAIIGLMVGGVVIA
    LVFFAEDVGSNKGAIIGLMVGGVVIA

Example with non-standard amino acids using HETATM lines in the PDB file,
in this case selenomethionine (MSE):

    >>> from Bio.PDB.PDBParser import PDBParser
    >>> from Bio.PDB.Polypeptide import PPBuilder
    >>> structure = PDBParser().get_structure('1A8O', 'PDB/1A8O.pdb')
    >>> ppb=PPBuilder()
    >>> for pp in ppb.build_peptides(structure):
    ...     print(pp.get_sequence())
    DIRQGPKEPFRDYVDRFYKTLRAEQASQEVKNW
    TETLLVQNANPDCKTILKALGPGATLEE
    TACQG

If you want to, you can include non-standard amino acids in the peptides:

    >>> for pp in ppb.build_peptides(structure, aa_only=False):
    ...     print(pp.get_sequence())
    ...     print("%s %s" % (pp.get_sequence()[0], pp[0].get_resname()))
    ...     print("%s %s" % (pp.get_sequence()[-7], pp[-7].get_resname()))
    ...     print("%s %s" % (pp.get_sequence()[-6], pp[-6].get_resname()))
    MDIRQGPKEPFRDYVDRFYKTLRAEQASQEVKNWMTETLLVQNANPDCKTILKALGPGATLEEMMTACQG
    M MSE
    M MSE
    M MSE

In this case the selenomethionines (the first and also seventh and sixth from
last residues) have been shown as M (methionine) by the get_sequence method.

Classes [hide private]
  Polypeptide
A polypeptide is simply a list of L{Residue} objects.
  _PPBuilder
Base class to extract polypeptides.
  CaPPBuilder
Use CA--CA distance to find polypeptides.
  PPBuilder
Use C--N distance to find polypeptides.
Functions [hide private]
 
index_to_one(index)
Index to corresponding one letter amino acid name.
source code
 
one_to_index(s)
One letter code to index.
source code
 
index_to_three(i)
Index to corresponding three letter amino acid name.
source code
 
three_to_index(s)
Three letter code to index.
source code
 
three_to_one(s)
Three letter code to one letter code.
source code
 
one_to_three(s)
One letter code to three letter code.
source code
 
is_aa(residue, standard=False)
Return True if residue object/string is an amino acid.
source code
Variables [hide private]
  standard_aa_names = ['ALA', 'CYS', 'ASP', 'GLU', 'PHE', 'GLY',...
  aa1 = 'ACDEFGHIKLMNPQRSTVWY'
  aa3 = ['ALA', 'CYS', 'ASP', 'GLU', 'PHE', 'GLY', 'HIS', 'ILE',...
  d1_to_index = {'A': 0, 'C': 1, 'D': 2, 'E': 3, 'F': 4, 'G': 5,...
  dindex_to_1 = {0: 'A', 1: 'C', 2: 'D', 3: 'E', 4: 'F', 5: 'G',...
  d3_to_index = {'ALA': 0, 'ARG': 14, 'ASN': 11, 'ASP': 2, 'CYS'...
  dindex_to_3 = {0: 'ALA', 1: 'CYS', 2: 'ASP', 3: 'GLU', 4: 'PHE...
  __package__ = 'Bio.PDB'
  i = 19
  n1 = 'Y'
  n3 = 'TYR'
Function Details [hide private]

index_to_one(index)

source code 
Index to corresponding one letter amino acid name.

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

one_to_index(s)

source code 
One letter code to index.

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

index_to_three(i)

source code 
Index to corresponding three letter amino acid name.

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

three_to_index(s)

source code 
Three letter code to index.

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

three_to_one(s)

source code 
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'

one_to_three(s)

source code 
One letter code to three letter code.

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

is_aa(residue, standard=False)

source code 
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


Variables Details [hide private]

standard_aa_names

Value:
['ALA',
 'CYS',
 'ASP',
 'GLU',
 'PHE',
 'GLY',
 'HIS',
 'ILE',
...

aa3

Value:
['ALA',
 'CYS',
 'ASP',
 'GLU',
 'PHE',
 'GLY',
 'HIS',
 'ILE',
...

d1_to_index

Value:
{'A': 0,
 'C': 1,
 'D': 2,
 'E': 3,
 'F': 4,
 'G': 5,
 'H': 6,
 'I': 7,
...

dindex_to_1

Value:
{0: 'A',
 1: 'C',
 2: 'D',
 3: 'E',
 4: 'F',
 5: 'G',
 6: 'H',
 7: 'I',
...

d3_to_index

Value:
{'ALA': 0,
 'ARG': 14,
 'ASN': 11,
 'ASP': 2,
 'CYS': 1,
 'GLN': 13,
 'GLU': 3,
 'GLY': 5,
...

dindex_to_3

Value:
{0: 'ALA',
 1: 'CYS',
 2: 'ASP',
 3: 'GLU',
 4: 'PHE',
 5: 'GLY',
 6: 'HIS',
 7: 'ILE',
...