Mercurial > repos > bgruening > chembl
annotate chembl.py @ 2:f56492688f43 draft
"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit d7fca21744d3c87cf173c1539c069a5c720084f3"
author | bgruening |
---|---|
date | Fri, 06 Sep 2019 07:50:15 -0400 |
parents | 6f8458d1cf46 |
children | 59eea7d0d720 |
rev | line source |
---|---|
1
6f8458d1cf46
"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 594b8bcfa2730fb21de1efa83f89e0380fdcaa0f"
bgruening
parents:
0
diff
changeset
|
1 from chembl_webresource_client.settings import Settings |
6f8458d1cf46
"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 594b8bcfa2730fb21de1efa83f89e0380fdcaa0f"
bgruening
parents:
0
diff
changeset
|
2 Settings.Instance().CACHING = False |
0
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
3 from chembl_webresource_client.new_client import new_client |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
4 import argparse |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
5 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
6 def open_file(filename): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
7 with open(filename) as f: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
8 return f.readline() |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
9 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
10 def get_smiles(res): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
11 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
12 Get a list of SMILES from function results |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
13 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
14 smiles = set() |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
15 for smi in res: |
2
f56492688f43
"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit d7fca21744d3c87cf173c1539c069a5c720084f3"
bgruening
parents:
1
diff
changeset
|
16 smiles.add('{}\t{}'.format(smi['molecule_structures']['canonical_smiles'], smi['molecule_chembl_id'])) |
0
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
17 return smiles |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
18 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
19 def sim_search(smiles, tanimoto): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
20 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
21 Return compounds which are within a Tanimoto range of the SMILES input |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
22 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
23 similarity = new_client.similarity |
2
f56492688f43
"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit d7fca21744d3c87cf173c1539c069a5c720084f3"
bgruening
parents:
1
diff
changeset
|
24 return similarity.filter(smiles=smiles, similarity=tanimoto).only(['molecule_structures', 'molecule_chembl_id']) |
0
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
25 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
26 def substr_search(smiles): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
27 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
28 Return compounds which contain the SMILES substructure input |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
29 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
30 substructure = new_client.substructure |
2
f56492688f43
"planemo upload for repository https://github.com/chembl/chembl_webresource_client commit d7fca21744d3c87cf173c1539c069a5c720084f3"
bgruening
parents:
1
diff
changeset
|
31 return substructure.filter(smiles=smiles).only(['molecule_structures', 'molecule_chembl_id']) |
0
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
32 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
33 def filter_drugs(mols): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
34 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
35 Return only compounds which are approved drugs |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
36 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
37 return mols.filter(max_phase=4) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
38 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
39 def filter_biotherapeutic(mols): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
40 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
41 Return only biotherapeutic molecules |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
42 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
43 return mols.filter(biotherapeutic__isnull=False) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
44 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
45 def filter_nat_prod(mols): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
46 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
47 Return only natural products |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
48 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
49 return mols.filter(natural_product=1) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
50 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
51 def filter_ro5(mols): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
52 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
53 Return only compounds with no RO5 violations |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
54 """ |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
55 return mols.filter(molecule_properties__num_ro5_violations=0) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
56 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
57 def main(): |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
58 parser = argparse.ArgumentParser(description='Search ChEMBL database for compounds') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
59 parser.add_argument('-i', '--input', help='SMILES input') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
60 parser.add_argument('-f', '--file', help='SMILES input as file') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
61 parser.add_argument('-o', '--output', help="SMILES output") |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
62 parser.add_argument('-t', '--tanimoto', type=int, help='Tanimoto similarity score') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
63 parser.add_argument('-s', '--substructure', action='store_true', help='Substructure search using the SMILES input.') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
64 parser.add_argument('-d', '--drugs', action='store_true', help='Filter approved drugs') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
65 parser.add_argument('-b', '--biotherapeutic', action='store_true', help='Filter biotherapeutic molecules') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
66 parser.add_argument('-n', '--nat-prod', action='store_true', help='Filter natural products') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
67 parser.add_argument('-r', '--ro5', action='store_true', help='Filter compounds that pass Lipinski RO5') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
68 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
69 args = parser.parse_args() |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
70 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
71 if args.file: # get SMILES from file rather than -i option |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
72 args.input = open_file(args.file) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
73 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
74 if len(args.input) < 5: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
75 raise IOError('SMILES must be at least 5 characters long.') |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
76 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
77 if args.substructure: # specify search type: substructure or similarity |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
78 mols = substr_search(args.input) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
79 else: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
80 mols = sim_search(args.input, args.tanimoto) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
81 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
82 # filter options: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
83 if args.drugs: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
84 mols = filter_drugs(mols) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
85 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
86 if args.biotherapeutic: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
87 mols = filter_biotherapeutic(mols) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
88 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
89 if args.nat_prod: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
90 mols = filter_nat_prod(mols) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
91 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
92 if args.ro5: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
93 mols = filter_ro5(mols) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
94 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
95 # get SMILES from search output |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
96 mols = get_smiles(mols) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
97 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
98 # write to file |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
99 with open(args.output, 'w') as f: |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
100 f.write('\n'.join(mols)) |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
101 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
102 |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
103 if __name__ == "__main__": |
915e9be38994
planemo upload for repository https://github.com/chembl/chembl_webresource_client commit 2e3c3c2bd7ecdc9c2968a32f91e81136e0cb3835
bgruening
parents:
diff
changeset
|
104 main() |