Skip to content

Commit

Permalink
save data file as .pkl output, only when fed with --save-raw
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Jun 19, 2024
1 parent d9185a4 commit 9b69bf9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changelog
## 1.2.5
* Allow `bean run .. tiling` for untranslated `--allele-df-key`.

## 1.2.8
* Change .pyx files to be compatible with more recent numpy versions
## 1.2.7
* **CRITICAL** Fix sample ordering & masking issue for survival screens
## 1.2.6
* Fix overflow in `bean run survival` and autograde error related to inplace assignment for `bean run survival tiling`.

## 1.2.7
* **CRITICAL** Fix sample ordering & masking issue for survival screens
## 1.2.5
* Allow `bean run .. tiling` for untranslated `--allele-df-key`.
9 changes: 7 additions & 2 deletions bean/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,20 @@ def main(args):
)
else:
param_history_dict_negctrl = None
save_dict["data"] = ndata
# Save results

outfile_path = (
f"{prefix}/bean_element[sgRNA]_result.{model_label}{args.result_suffix}.csv"
)
info(f"Done running inference. Writing result at {outfile_path}...")
if not os.path.exists(prefix):
os.makedirs(prefix)
with open(f"{prefix}/{model_label}.result{args.result_suffix}.pkl", "wb") as handle:
pkl.dump(save_dict, handle)
if args.save_raw:
with open(
f"{prefix}/{model_label}.result{args.result_suffix}.pkl", "wb"
) as handle:
pkl.dump(save_dict, handle)
write_result_table(
target_info_df,
param_history_dict,
Expand Down
5 changes: 5 additions & 0 deletions bean/model/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,10 @@ def parse_args(parser=None):
action="store_true",
help="Load existing .pkl file if present.",
)
parser.add_argument(
"--save-raw", # TODO: add check args
action="store_true",
help="Write .pkl file with raw input/output.",
)

return parser

0 comments on commit 9b69bf9

Please sign in to comment.