Skip to content
Snippets Groups Projects
Commit 6a3f4a08 authored by pswain's avatar pswain
Browse files

add example scripts

parent 0bf283bd
No related branches found
No related tags found
No related merge requests found
from wela.dataloader import dataloader
datasets = ["Pdr5_3_11_22", "Pdr5_flc_10ugml_1676"]
for dataname in datasets:
dl = dataloader(
h5dir="/Users/pswain/ecdf/swainlab/aliby_datasets/ivan",
wdir="/Users/pswain/wip/tsv_data",
)
dl.load(dataname, key_index="median_GFP")
dl.save()
from wela.dataloader import dataloader
from wela.plotting import kymograph, plot_lineage
# from genutils import figs2pdf
import matplotlib.cm
datasets = ["Pdr5_3_11_22", "Pdr5_flc_10ugml_1676"]
for dataname in datasets:
dl = dataloader(".", "/Users/pswain/wip/tsv_data")
dl.load(dataname, use_tsv=True)
df = dl.get_sorted_df("median_GFP")
title = dataname.split(".")[0]
kymograph(df, hue="buddings", title=title)
kymograph(df, hue="median_GFP", title=title)
kymograph(
df,
hue="bud_growth_rate",
title=title,
vmin=-50,
vmax=50,
cmap=matplotlib.cm.Spectral,
)
# df.id = df.id.astype("object")
# df.to_csv(dataname + ".tsv", sep="\t", index=False)
# figs2pdf("fluconazole")
if False:
plot_lineage(dl.ids[34], dl.df)
from wela.growth_rate import find_all_grs, add_to_dataloader
from wela.dataloader import dataloader
run_GP = False
wdir = "/Users/pswain/wip/tsv_data"
datasets = ["Pdr5_3_11_22", "Pdr5_flc_10ugml_1676"]
# it is better to run dataloader first to generate a tsv file
# to run directly on h5 files, add use_tsv=False
for dataname in datasets:
if run_GP:
# generate pkl files and pdf files for inspection
# run first with max_no_cells=2 to check the results
find_all_grs(dataname, max_no_cells=None, wdir=wdir)
else:
# add pkl files to df
dl = dataloader(wdir=wdir)
dl.load(dataname, use_tsv=True)
add_to_dataloader(dl, wdir)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment