@@ -329,11 +329,19 @@ def _spectrum_generator(filename, min_rt, max_rt):
329329def _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