forked from fak/mapChEMBLPfam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetUniprotTargets.py
26 lines (23 loc) · 904 Bytes
/
getUniprotTargets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
Function: getUniprotTargets
gets all protein accession with db_source swiss-prot or trembl from the Chembl
target dictionary
"""
import queryDevice
def getUniprotTargets(release, user, pword, host, port):
release_number = int(release.split('_')[1])
if release_number >= 15:
rawtargets = queryDevice.queryDevice("""SELECT cs.accession
FROM component_sequences cs
JOIN target_components tc
ON tc.component_id = cs.component_id
WHERE db_source IN('SWISS-PROT', 'TREMBL')""", release, user, pword, host, port)
else:
rawtargets = queryDevice.queryDevice("""SELECT protein_accession
FROM target_dictionary
WHERE db_source IN('SWISS-PROT', 'TREMBL')""", release, user, pword, host, port)
targets= []
for target in rawtargets:
targets.append(target[0])
return targets