micom-dev / micom

Python package to study microbial communities using metabolic modeling.
https://micom-dev.github.io/micom
Apache License 2.0
82 stars 17 forks source link

saving intermediate output from "grow" #181

Open zoey-rw opened 1 month ago

zoey-rw commented 1 month ago

I'm wondering what the best approach would be to save output from the "grow" workflow in case it does not complete for a large dataset. I'm splitting my manifest file by rows into smaller chunks, which produces many results files, and still sometimes stalls at 98-99% complete, which might just be due to one problematic sample (right?)

Would you recommend modifying the internal "_growth" function to save results right before the "return" call? Ideally, the growth results could then be combined to still be used as inputs for visualizations.

Thanks!

cdiener commented 1 month ago

Sorry to hear you're still having problems with hanging samples. Did you try version 0.35.0 by any chance? That at least should be more stable in the workflows. It kind of does what you are asking already in the sense that if a sample actually fails it will return the solution for all the others. But there is no caching or restart mechanism.

You could also manage it yourself because grow in principle works fine with a single sample as well. That could be integrated in Nextflow (this is planned from) or Snakemake to get what you are asking.