andersen-lab / Freyja

Depth-weighted De-Mixing
BSD 2-Clause "Simplified" License
100 stars 29 forks source link

Add option to retain intermediate figure outputs #195

Closed jchorl closed 5 months ago

jchorl commented 6 months ago

Hi!

First, thanks for Freyja. It's a great tool.

I'm looking to integrate some plots into other reporting. Specifically, I'm interested in this figure.

Currently, freyja cleans up intermediate charts (probably a good choice). Would you be open to a config/flag to retain intermediate charts?

There's a couple ways I could see implementing this:

  1. We could add a flag like --temp-plot-data-dir to the dash command and store csv/html intermediate data in there. If a user provided it, we could refrain from cleaning it up, else we could just use a tmp dir.
  2. We could add a field to the config file to specify a directory to put intermediary data
  3. We could add a flag like --keep-intermediary-files and just skip the os.remove if that flag is provided

Anyway, I'm flexible on implementation. Is this functionality that you would consider adopting? If so, happy to cut a PR.

joshuailevy commented 6 months ago

Hey @jchorl!

Thanks! For sure, we'd be more than happy to incorporate this sort of functionality. Options 1 and 3 both sounds good to me -- if there's a particular option that works best for your workflow, we can do that.

If you want to throw together a PR that'd be awesome, much appreciated!

joshuailevy commented 5 months ago

Should be sorted out by recent push and will be included in next release.

jchorl commented 5 months ago

Wow, thank you so much! I'd been meaning to get to it but haven't found time. I really appreciate this!

joshuailevy commented 5 months ago

No prob!