diff --git a/dataloader.py b/dataloader.py index 2e989d69516e2e3bdf9419e8b7ba22ec9f0d13d4..55097c7ae93f967b7504e5411a6235f943f75b63 100644 --- a/dataloader.py +++ b/dataloader.py @@ -343,7 +343,7 @@ class dataloader: Name of the file """ r_df = pd.read_csv(str(self.wdirpath / (dataname + ".tsv")), sep="\t") - print("\nloaded", dataname) + print("\nLoaded", dataname) if hasattr(self, "r"): # merge new data to current dataframe self.df = pd.merge(self.df, r_df, how="left") diff --git a/examples/run_gr.py b/examples/run_gr.py index 51fbd12c240e34d3dec730bf9a4c1756a2db064b..dc376fe550208bf714ee08f94e0026f6c4e5f8c1 100644 --- a/examples/run_gr.py +++ b/examples/run_gr.py @@ -1,10 +1,17 @@ -from wela.growth_rate import find_all_grs, add_to_dataloader +from wela.growth_rate import find_all_grs, add_gr_from_pkl from wela.dataloader import dataloader run_GP = False wdir = "/Users/pswain/wip/tsv_data" -datasets = ["Pdr5_3_11_22", "Pdr5_flc_10ugml_1676"] + +datasets = [ + "922_2023_03_03_pyrToGalplusGlc_00", + "1005_2023_03_09_exp_00_pyrToGalInduction", + "1574_2023_04_04_pyrTo0_1glc_00", + "1334_2023_03_28_pyrTo2Gal_01glc_00", +] + # it is better to run dataloader first to generate a tsv file # to run directly on h5 files, add use_tsv=False @@ -18,6 +25,6 @@ for dataname in datasets: # add pkl files to df dl = dataloader(wdir=wdir) dl.load(dataname, use_tsv=True) - add_to_dataloader(dl, wdir) + add_gr_from_pkl(dl, wdir) # add data to existing tsv file - # dl.save() + dl.save() diff --git a/growth_rate.py b/growth_rate.py index ca9d509afef5b74bcc42c68981550eb66ee149fc..24660666ae3796db44ca1c667fd3a660eece4a15 100644 --- a/growth_rate.py +++ b/growth_rate.py @@ -72,14 +72,6 @@ def find_all_grs( plt.close("all") -def add_to_dataloader(dl, pkl_dir=".", savename=None): - """Add data from pkl files to a dataloader's data frame.""" - addgrfrompkl(dl, pkl_dir) - if savename is None: - savename = dl.dataname - dl.save(savename) - - def find_gr( volume_df, buddings_df=None, @@ -251,7 +243,7 @@ def reNaN(oldlist, i_nan): return oldlist -def addgrfrompkl(dl, pkldir): +def add_gr_from_pkl(dl, pkldir): """ Load growth rate from pickle files.