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 pp.get_sequence()[0], pp[0].get_resname()
... print pp.get_sequence()[-7], pp[-7].get_resname()
... print 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
is_aa(residue,
standard=False)
Return True if residue object/string is an amino acid. |
source code
|
|
|
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 '
|
Index to corresponding one letter amino acid name.
>>> index_to_one(0)
'A'
>>> index_to_one(19)
'Y'
|
One letter code to index.
>>> one_to_index('A')
0
>>> one_to_index('Y')
19
|
Index to corresponding three letter amino acid name.
>>> index_to_three(0)
'ALA'
>>> index_to_three(19)
'TYR'
|
Three letter code to index.
>>> three_to_index('ALA')
0
>>> three_to_index('TYR')
19
|
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 letter code to three letter code.
>>> one_to_three('A')
'ALA'
>>> one_to_three('Y')
'TYR'
|
Return True if residue object/string is an amino acid.
- Parameters:
residue (Residue or string) - a Residue object OR a three letter amino acid code
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 ) - flag to check for the 20 AA (default false)
|
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 ' ,
...
|
|