Mercurial > repos > bgruening > sucos_max_score
comparison sucos_max.py @ 4:85fad59f8168 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/sucos commit 2a74332a201fa9bb53f8e7dc3cc497f653d12929"
author | bgruening |
---|---|
date | Mon, 06 Apr 2020 09:12:07 -0400 |
parents | bf99565cec1f |
children | d4c67ced6abc |
comparison
equal
deleted
inserted
replaced
3:bf99565cec1f | 4:85fad59f8168 |
---|---|
78 except: | 78 except: |
79 utils.log("WARNING: failed to generate features for molecule", mol_num, "in input") | 79 utils.log("WARNING: failed to generate features for molecule", mol_num, "in input") |
80 continue | 80 continue |
81 scores_max = [0, 0, 0] | 81 scores_max = [0, 0, 0] |
82 scores_cum = [0, 0, 0] | 82 scores_cum = [0, 0, 0] |
83 cluster_name = None | |
83 for clusterfilename in all_clusters: | 84 for clusterfilename in all_clusters: |
84 cluster = all_clusters[clusterfilename] | 85 cluster = all_clusters[clusterfilename] |
85 index = 0 | 86 index = 0 |
86 for entry in cluster: | 87 for entry in cluster: |
87 hit = entry[0] | 88 hit = entry[0] |
102 scores_cum[0] += sucos_score | 103 scores_cum[0] += sucos_score |
103 scores_cum[1] += fm_score | 104 scores_cum[1] += fm_score |
104 scores_cum[2] += vol_score | 105 scores_cum[2] += vol_score |
105 | 106 |
106 | 107 |
107 cluster_file_name_only = cluster_name.split(os.sep)[-1] | |
108 | |
109 # utils.log("Max SuCOS:", scores[0], "FM:", scores[1], "P:", scores[2],"File:", cluster_file_name_only, "Index:", cluster_index) | 108 # utils.log("Max SuCOS:", scores[0], "FM:", scores[1], "P:", scores[2],"File:", cluster_file_name_only, "Index:", cluster_index) |
110 mol.SetDoubleProp("Max_SuCOS_Score", scores_max[0] if scores_max[0] > 0 else 0) | 109 mol.SetDoubleProp("Max_SuCOS_Score", scores_max[0] if scores_max[0] > 0 else 0) |
111 mol.SetDoubleProp("Max_SuCOS_FeatureMap_Score", scores_max[1] if scores_max[1] > 0 else 0) | 110 mol.SetDoubleProp("Max_SuCOS_FeatureMap_Score", scores_max[1] if scores_max[1] > 0 else 0) |
112 mol.SetDoubleProp("Max_SuCOS_Protrude_Score", scores_max[2] if scores_max[2] > 0 else 0) | 111 mol.SetDoubleProp("Max_SuCOS_Protrude_Score", scores_max[2] if scores_max[2] > 0 else 0) |
113 mol.SetProp("Max_SuCOS_Cluster", cluster_file_name_only) | 112 |
114 mol.SetIntProp("Max_SuCOS_Index", cluster_index) | 113 if cluster_name: |
114 cluster_file_name_only = cluster_name.split(os.sep)[-1] | |
115 mol.SetProp("Max_SuCOS_Cluster", cluster_file_name_only) | |
116 mol.SetIntProp("Max_SuCOS_Index", cluster_index) | |
115 | 117 |
116 # utils.log("Cum SuCOS:", scores[0], "FM:", scores[1], "P:", scores[2]) | 118 # utils.log("Cum SuCOS:", scores[0], "FM:", scores[1], "P:", scores[2]) |
117 mol.SetDoubleProp("Cum_SuCOS_Score", scores_cum[0] if scores_cum[0] > 0 else 0) | 119 mol.SetDoubleProp("Cum_SuCOS_Score", scores_cum[0] if scores_cum[0] > 0 else 0) |
118 mol.SetDoubleProp("Cum_SuCOS_FeatureMap_Score", scores_cum[1] if scores_cum[1] > 0 else 0) | 120 mol.SetDoubleProp("Cum_SuCOS_FeatureMap_Score", scores_cum[1] if scores_cum[1] > 0 else 0) |
119 mol.SetDoubleProp("Cum_SuCOS_Protrude_Score", scores_cum[2] if scores_cum[2] > 0 else 0) | 121 mol.SetDoubleProp("Cum_SuCOS_Protrude_Score", scores_cum[2] if scores_cum[2] > 0 else 0) |