Skip to content

Commit eb5eb83

Browse files
authored
Merge pull request #306 from Wang-Bioinformatics-Lab/udi-fix
Adding GNPS2 support for UDI for overlays
2 parents c32fc3c + 3139540 commit eb5eb83

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
),
163163
dbc.Nav(
164164
[
165-
dbc.NavItem(dbc.NavLink("GNPS2 LCMS Dashboard - Version 2025-10-03", href="/")),
165+
dbc.NavItem(dbc.NavLink("GNPS2 LCMS Dashboard - Version 2025.10.17", href="/")),
166166
dbc.NavItem(dbc.NavLink("Documentation", href="https://ccms-ucsd.github.io/GNPSDocumentation/lcms-dashboard/")),
167167
dbc.NavItem(dbc.NavLink("GNPS Datasets", href="https://gnps.ucsd.edu/ProteoSAFe/datasets.jsp#%7B%22query%22%3A%7B%7D%2C%22table_sort_history%22%3A%22createdMillis_dsc%22%2C%22title_input%22%3A%22GNPS%22%7D")),
168168
dbc.NavItem(id="dataset_files_nav"),

utils.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,19 @@ def _spectrum_generator(filename, min_rt, max_rt):
329329
def _resolve_overlay(overlay_usi, overlay_mz, overlay_rt, overlay_filter_column, overlay_filter_value, overlay_size, overlay_color, overlay_hover, overlay_tabular_data=""):
330330
# Let's try the UDI
331331
try:
332-
overlay_usi_splits = overlay_usi.split(":")
333-
file_path = overlay_usi_splits[2].split("-")[-1]
334-
task = overlay_usi_splits[2].split("-")[1]
335-
url = "http://massive.ucsd.edu/ProteoSAFe/DownloadResultFile?task={}&block=main&file={}".format(task, file_path)
336-
overlay_df = pd.read_csv(url, sep=None, nrows=400000)
332+
if "GNPS2" in overlay_usi:
333+
overlay_usi_splits = overlay_usi.split(":")
334+
file_path = overlay_usi_splits[2].split("-")[-1]
335+
task = overlay_usi_splits[2].split("-")[1]
336+
337+
url = "https://gnps2.org/resultfile?task={}&file={}".format(task, file_path)
338+
overlay_df = pd.read_csv(url, sep=None, nrows=400000)
339+
else:
340+
overlay_usi_splits = overlay_usi.split(":")
341+
file_path = overlay_usi_splits[2].split("-")[-1]
342+
task = overlay_usi_splits[2].split("-")[1]
343+
url = "http://massive.ucsd.edu/ProteoSAFe/DownloadResultFile?task={}&block=main&file={}".format(task, file_path)
344+
overlay_df = pd.read_csv(url, sep=None, nrows=400000)
337345
except:
338346
if len(overlay_tabular_data) > 0:
339347
# if this fails, we can try parsing overlay_tabular_data

0 commit comments

Comments
 (0)