Skip to content

Commit

Permalink
Save time-to-first-binding data points (#384)
Browse files Browse the repository at this point in the history
* save ttfb values

* fixes
  • Loading branch information
ordabayevy authored Nov 9, 2022
1 parent 1f4a893 commit 29590ab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tapqir/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 29590ab

Please sign in to comment.