annotate sucos_max.py @ 6:b8725fec8c7b draft default tip

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
author bgruening
date Wed, 14 Apr 2021 09:30:48 +0000
parents 791c86130585
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
1 #!/usr/bin/env python
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
2 """
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
3 Assess ligands against a second set of molecules using SuCOS scores.
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
4 This is a quite specialised function that is designed to take a set of potential follow up
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
5 compounds and compare them to a set of clustered fragment hits to help identify which follow up
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
6 ligands best map to the binding space of the hits.
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
7
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
8 The clustering of the fragment hits is expected to be performed with the sucos_cluster.py module
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
9 and will generate a set of SD files, one for each cluster of hits (presumably corresponding to a
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
10 binding pocket in the protein target).
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
11
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
12 Each molecule in the input ligands is then compared (using SuCOS) to each hit in the clusters. There
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
13 are different modes which determine how the ligand is assessed.
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
14
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
15 In mode 'max' the hit with the best SuCOS score is identified. The output is a SD file with each of the ligands,
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
16 with these additional fields for each molecule:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
17 Max_SuCOS_Score - the best score
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
18 Max_SuCOS_FeatureMap_Score - the feature map score for the hit that has the best SuCOS score
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
19 Max_SuCOS_Protrude_Score - the protrude volume for the hit that has the best SuCOS score
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
20 Max_SuCOS_Cluster - the name of the cluster SD file that contains the best hit
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
21 Max_SuCOS_Index - the index of the best hit in the SD file
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
22
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
23 In mode 'cum' the sum of all the scores is calculated and reported as the following properties for each molecule:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
24 Cum_SuCOS_Score property: the sum of the SuCOS scores
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
25 Cum_SuCOS_FeatureMap_Score: the sum of the feature map scores
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
26 Cum_SuCOS_Protrude_Score: the sum of the protrude volume scores
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
27
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
28 If a molecule has no alignment to any of the clustered hits (all alignment scores of zero) then it is not
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
29 included in the results.
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
30
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
31
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
32 SuCOS is the work of Susan Leung.
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
33 GitHub: https://github.com/susanhleung/SuCOS
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
34 Publication: https://doi.org/10.26434/chemrxiv.8100203.v1
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
35 """
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
36
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
37 import argparse
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
38 import os
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
39
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
40 import sucos
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
41 import utils
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
42 from rdkit import Chem
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
43
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
44
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
45 def process(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
46 inputfilename, clusterfilenames, outputfilename, filter_value, filter_field
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
47 ):
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
48 all_clusters = {}
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
49 for filename in clusterfilenames:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
50 cluster = []
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
51 cluster_file = utils.open_file_for_reading(filename)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
52 suppl = Chem.ForwardSDMolSupplier(cluster_file)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
53 i = 0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
54 for mol in suppl:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
55 i += 1
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
56 if not mol:
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
57 utils.log(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
58 "WARNING: failed to generate molecule", i, "in cluster", filename
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
59 )
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
60 continue
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
61 try:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
62 features = sucos.getRawFeatures(mol)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
63 cluster.append((mol, features))
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
64 except Exception:
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
65 utils.log(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
66 "WARNING: failed to generate features for molecule",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
67 i,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
68 "in cluster",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
69 filename,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
70 )
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
71
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
72 cluster_file.close()
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
73 all_clusters[filename] = cluster
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
74
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
75 input_file = utils.open_file_for_reading(inputfilename)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
76 suppl = Chem.ForwardSDMolSupplier(input_file)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
77 output_file = utils.open_file_for_writing(outputfilename)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
78 writer = Chem.SDWriter(output_file)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
79
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
80 comparisons = 0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
81 mol_num = 0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
82
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
83 for mol in suppl:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
84 mol_num += 1
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
85 if not mol:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
86 utils.log("WARNING: failed to generate molecule", mol_num, "in input")
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
87 continue
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
88 try:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
89 query_features = sucos.getRawFeatures(mol)
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
90 except Exception:
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
91 utils.log(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
92 "WARNING: failed to generate features for molecule", mol_num, "in input"
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
93 )
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
94 continue
2
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
95 scores_max = [0, 0, 0]
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
96 scores_cum = [0, 0, 0]
4
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
97 cluster_name = None
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
98 for clusterfilename in all_clusters:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
99 cluster = all_clusters[clusterfilename]
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
100 index = 0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
101 for entry in cluster:
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
102 hit = entry[0]
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
103 ref_features = entry[1]
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
104 index += 1
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
105 comparisons += 1
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
106 sucos_score, fm_score, vol_score = sucos.get_SucosScore(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
107 hit,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
108 mol,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
109 tani=False,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
110 ref_features=ref_features,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
111 query_features=query_features,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
112 )
2
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
113
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
114 if sucos_score > scores_max[0]:
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
115 scores_max[0] = sucos_score
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
116 scores_max[1] = fm_score
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
117 scores_max[2] = vol_score
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
118 cluster_name = clusterfilename
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
119 cluster_index = index
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
120
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
121 scores_cum[0] += sucos_score
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
122 scores_cum[1] += fm_score
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
123 scores_cum[2] += vol_score
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
124
3
bd12f4b4c3a8 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 8542cbcae3ebed4cb9a6c20b1fabd418a6efb7e8"
bgruening
parents: 2
diff changeset
125 # utils.log("Max SuCOS:", scores[0], "FM:", scores[1], "P:", scores[2],"File:", cluster_file_name_only, "Index:", cluster_index)
bd12f4b4c3a8 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 8542cbcae3ebed4cb9a6c20b1fabd418a6efb7e8"
bgruening
parents: 2
diff changeset
126 mol.SetDoubleProp("Max_SuCOS_Score", scores_max[0] if scores_max[0] > 0 else 0)
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
127 mol.SetDoubleProp(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
128 "Max_SuCOS_FeatureMap_Score", scores_max[1] if scores_max[1] > 0 else 0
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
129 )
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
130 mol.SetDoubleProp(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
131 "Max_SuCOS_Protrude_Score", scores_max[2] if scores_max[2] > 0 else 0
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
132 )
4
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
133
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
134 if cluster_name:
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
135 cluster_file_name_only = cluster_name.split(os.sep)[-1]
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
136 mol.SetProp("Max_SuCOS_Cluster", cluster_file_name_only)
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
137 mol.SetIntProp("Max_SuCOS_Index", cluster_index)
3
bd12f4b4c3a8 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 8542cbcae3ebed4cb9a6c20b1fabd418a6efb7e8"
bgruening
parents: 2
diff changeset
138
bd12f4b4c3a8 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 8542cbcae3ebed4cb9a6c20b1fabd418a6efb7e8"
bgruening
parents: 2
diff changeset
139 # utils.log("Cum SuCOS:", scores[0], "FM:", scores[1], "P:", scores[2])
bd12f4b4c3a8 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 8542cbcae3ebed4cb9a6c20b1fabd418a6efb7e8"
bgruening
parents: 2
diff changeset
140 mol.SetDoubleProp("Cum_SuCOS_Score", scores_cum[0] if scores_cum[0] > 0 else 0)
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
141 mol.SetDoubleProp(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
142 "Cum_SuCOS_FeatureMap_Score", scores_cum[1] if scores_cum[1] > 0 else 0
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
143 )
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
144 mol.SetDoubleProp(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
145 "Cum_SuCOS_Protrude_Score", scores_cum[2] if scores_cum[2] > 0 else 0
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
146 )
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
147
4
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
148 if filter_value and filter_field:
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
149 if mol.HasProp(filter_field):
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
150 val = mol.GetDoubleProp(filter_field)
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
151 if val > filter_value:
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
152 writer.write(mol)
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
153 else:
791c86130585 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit c35334ca80c87a5078da1a6df85b34e23b80d837"
bgruening
parents: 3
diff changeset
154 writer.write(mol)
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
155
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
156 input_file.close()
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
157 writer.flush()
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
158 writer.close()
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
159 output_file.close()
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
160
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
161 utils.log("Completed", comparisons, "comparisons")
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
162
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
163
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
164 # start main execution #########################################
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
165
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
166
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
167 def main():
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
168 parser = argparse.ArgumentParser(description="Max SuCOS scores with RDKit")
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
169 parser.add_argument(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
170 "-i",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
171 "--input",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
172 help="Input file to score in SDF format. Can be gzipped (*.gz).",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
173 )
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
174 parser.add_argument(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
175 "-o", "--output", help="Output file in SDF format. Can be gzipped (*.gz)."
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
176 )
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
177 parser.add_argument(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
178 "clusters", nargs="*", help="One or more SDF files with the clustered hits"
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
179 )
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
180 parser.add_argument(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
181 "--filter-value",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
182 type=float,
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
183 help="Filter out values with scores less than this.",
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
184 )
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
185 parser.add_argument("--filter-field", help="Field to use to filter values.")
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
186
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
187 args = parser.parse_args()
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
188 utils.log("Max SuCOS Args: ", args)
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
189
6
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
190 process(
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
191 args.input, args.clusters, args.output, args.filter_value, args.filter_field
b8725fec8c7b "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 05dc325ce687441e5d3bdbdedcc0e3529cd5e070"
bgruening
parents: 4
diff changeset
192 )
0
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
193
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
194
f80cfac80c53 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit ef86cfa5f7ab5043de420511211579d03df58645"
bgruening
parents:
diff changeset
195 if __name__ == "__main__":
2
58d18838e244 "planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 6f1ee2812cca091561a2b2e464498dae2f913b8d"
bgruening
parents: 0
diff changeset
196 main()