diff --git a/src/wela/dataloader.py b/src/wela/dataloader.py index 1e2a464eb5a090d08f0ee8e75d595c7f5b80fa2c..2dee3425f344982ab76b4031d0427e557514842a 100644 --- a/src/wela/dataloader.py +++ b/src/wela/dataloader.py @@ -1,3 +1,4 @@ +import os import pprint from pathlib import Path @@ -8,6 +9,7 @@ from wela.correct_buds import correct_buds try: from postprocessor.grouper import Grouper + from wela.add_bud_fluorescence import add_bud_fluorescence except ModuleNotFoundError: print("Can only load tsv files - cannot find aliby's postprocessor.") @@ -777,3 +779,17 @@ def sort_df(df, signal, functionstr="sum"): rdf = rdf.sort_values(by="id") # return sorted dataframe return rdf + + +def find_full_omid(omid: str or int, outdir: str): + """ + Find full name of experiment from an OMERO ID. + + Search outdir directory for name. + """ + full_omid = [ + f + for f in os.listdir(outdir) + if os.path.isdir(os.path.join(outdir, f)) and str(omid) in f + ].pop() + return full_omid