allpy
view allpy/pdb.py @ 304:e5c8deea6f83
Added docstrings to allpy.util
author | Daniil Alexeyevsky <me.dendik@gmail.com> |
---|---|
date | Thu, 16 Dec 2010 19:15:34 +0300 |
parents | 4a2341bc90b1 |
children | 4d610c277281 |
line source
1 """ Functions to get pdb information from fasta id
2 and to generate fasta id from pdb information
4 pdb information: code, chain, model
6 TODO: same for local pdb files
7 """
15 # for pdb-codes
16 re1 = re.compile(r"(^|[^a-z0-9])(?P<code>[0-9][0-9a-z]{3})([^a-z0-9](?P<chain>[0-9a-z ]?)(?P<model>[^a-z0-9]([0-9]{1,3}))?)?", re.I)
18 #~ # for files
19 #~ re2 = re.compile(r"(^)([^^]+\.(ent|pdb))([^a-zA-Z0-9]([0-9A-Za-z ]?)([^a-zA-Z0-9]([0-9]{1,3}))?)?$")
44 #~ def std_id_parse(ID):
45 #~ """
46 #~ Parse standart ID to pdb_code, chain and model
47 #~ """
48 #~ if '.ent' in ID.lower() or '.pdb' in ID.lower():
49 #~ # it is file
50 #~ parseO = self.re2.search(ID) # files
51 #~ else:
52 #~ parseO = self.re1.search(ID.lower()) # pdb codes
53 #~ if not parseO:
54 #~ return None
55 #~ parse = parseO.groups()
56 #~ if len(parse) < 2:
57 #~ return None
58 #~ code = parse[1]
59 #~ chain = ''
60 #~ model = None
61 #~ if len(parse) >= 4:
62 #~ chain = parse[3]
63 #~ if chain:
64 #~ chain = chain.upper()
65 #~ if len(parse) >= 6:
66 #~ if parse[5]:
67 #~ model = parse[5]
68 #~ return code, chain, model
71 """Sequence with associated PDB structure.
73 Attributes:
75 * pdb_chain -- Bio.PDB.Chain
76 * pdb_file -- file object
78 * pdb_residues -- {Monomer: Bio.PDB.Residue}
79 * pdb_secstr -- {Monomer: 'Secondary structure'}
80 Code Secondary structure
81 H alpha-helix
82 B Isolated beta-bridge residue
83 E Strand
84 G 3-10 helix
85 I pi-helix
86 T Turn
87 S Bend
88 - Other
91 ?TODO: global pdb_structures
92 """
101 """ Reads Pdb chain from file
103 and align each Monomer with PDB.Residue (TODO)
104 """
121 """ Delete all pdb-connected links """
122 #~ gc.get_referrers(self.pdb_chains[0])
128 @staticmethod
130 """ Returns Sequence with Monomers with link to Bio.PDB.Residue
132 chain is Bio.PDB.Chain
133 """
149 """ Adds pdb information to each monomer
151 Returns if information has been successfully added
152 TODO: conformity_file
154 id-format lava flow
155 """
179 """ Saves pdb_chain to out_file """
193 """ Add secondary structure data """
219 """ Returns string representing secondary structure """
224 # vim: set ts=4 sts=4 sw=4 et: