Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion molecular-librarysearch-v2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ include ../Makefile.deploytemplate

WORKFLOW_NAME=molecular-librarysearch-v2
TOOL_FOLDER_NAME=molecularsearch
WORKFLOW_VERSION=release_28
WORKFLOW_VERSION=release_29
WORKFLOW_DESCRIPTION="One of the major limitations in discovering new chemical entities is determining which metabolites are known compounds within complex biological samples. A way to overcome this limitation is to compare the MS2 spectra of the unknown metabolite with a library of MS/MS spectra generated from structurally characterized metabolites. Herein, this comparison is based upon the similarity cosine scoring of MS/MS spectra."
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def main():
input_filename = sys.argv[1]
output_tsv = sys.argv[2]

# Loading annotations
results_list = ming_fileio_library.parse_table_with_headers_object_list(input_filename)
results_by_compound_name = defaultdict(list)
for result in results_list:
Expand All @@ -26,9 +27,15 @@ def main():
for compound_name in results_by_compound_name:
best_result = sorted(results_by_compound_name[compound_name], key=lambda result: float(result["MQScore"]), reverse=True)[0]

all_RTs = [float(result["RT_Query"]) for result in results_by_compound_name[compound_name]]
all_MZs = [float(result["SpecMZ"]) for result in results_by_compound_name[compound_name]]
all_MZ_ppmerror = [float(result["MZErrorPPM"]) for result in results_by_compound_name[compound_name]]
# Calculating errors, handling errors
try:
all_RTs = [float(result["RT_Query"]) for result in results_by_compound_name[compound_name]]
all_MZs = [float(result["SpecMZ"]) for result in results_by_compound_name[compound_name]]
all_MZ_ppmerror = [float(result["MZErrorPPM"]) for result in results_by_compound_name[compound_name]]
except:
all_RTs = [-1]
all_MZs = [-1]
all_MZ_ppmerror = [-1]

rt_mean = statistics.mean(all_RTs)
rt_median = statistics.median(all_RTs)
Expand Down