diff --git a/tapqir/main.py b/tapqir/main.py index ae11ded..a62afd1 100644 --- a/tapqir/main.py +++ b/tapqir/main.py @@ -916,6 +916,7 @@ def subset(): time1=data.time1, ttb=data.ttb, name=data.name, + channels=data.channels, ) save(subset_data, subset_path) logger.info("Created a new data file at `subset/data.tpqr`") @@ -1009,6 +1010,11 @@ def ttfb( Tmax = model.data.F torch.manual_seed(0) data = time_to_first_binding(z_samples[..., c]) + data_df = pd.DataFrame(data=data) + data_df.to_csv(cd / f"{model.name}_ttfb-data-points-channel{c}.csv") + logger.info( + f"Saved time-to-first-binding values in {model.name}_ttfb-data-points-channel{c}.csv file" + ) # use cuda torch.set_default_tensor_type(torch.cuda.FloatTensor) @@ -1083,8 +1089,10 @@ def ttfb( "fraction bound 95% ul": fb_ul, } ) - fit_df.to_csv(cd / f"{model.name}_ttfb-data-channel{c}.csv") - logger.info(f"Saved fit data in {model.name}_ttfb-data-channel{c}.csv file") + fit_df.to_csv(cd / f"{model.name}_ttfb-fraction-bound-channel{c}.csv") + logger.info( + f"Saved fit data in {model.name}_ttfb-fraction-bound-channel{c}.csv file" + ) ax.fill_between(torch.arange(Tmax), fb_ll, fb_ul, alpha=0.3, color="C2") ax.plot(torch.arange(Tmax), fb_mean, color="C2")