allpy
view lib/allpy_pdb.py @ 164:9adbec7c3366
wt: test: multiple const char* const turnes out not to cause problems
It must cause problems on linking!
Help me!
author | boris <bnagaev@gmail.com> |
---|---|
date | Sun, 31 Oct 2010 13:10:45 +0300 |
parents | 93ac1bdda779 |
children |
line source
4 """ Functions to get pdb information from fasta id
5 and to generate fasta id from pdb information
7 pdb information: code, chain, model
9 TODO: same for local pdb files
10 """
12 # for pdb-codes
13 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)
15 #~ # for files
16 #~ re2 = re.compile(r"(^)([^^]+\.(ent|pdb))([^a-zA-Z0-9]([0-9A-Za-z ]?)([^a-zA-Z0-9]([0-9]{1,3}))?)?$")
41 #~ def std_id_parse(ID):
42 #~ """
43 #~ Parse standart ID to pdb_code, chain and model
44 #~ """
45 #~ if '.ent' in ID.lower() or '.pdb' in ID.lower():
46 #~ # it is file
47 #~ parseO = self.re2.search(ID) # files
48 #~ else:
49 #~ parseO = self.re1.search(ID.lower()) # pdb codes
50 #~ if not parseO:
51 #~ return None
52 #~ parse = parseO.groups()
53 #~ if len(parse) < 2:
54 #~ return None
55 #~ code = parse[1]
56 #~ chain = ''
57 #~ model = None
58 #~ if len(parse) >= 4:
59 #~ chain = parse[3]
60 #~ if chain:
61 #~ chain = chain.upper()
62 #~ if len(parse) >= 6:
63 #~ if parse[5]:
64 #~ model = parse[5]
65 #~ return code, chain, model