jbloomlab / dms_variants

Analyze deep mutational scanning of barcoded variants.
Other
6 stars 9 forks source link

better caching for better pickling of epistasis models #25

Closed jbloom closed 4 years ago

jbloom commented 4 years ago

The global epistasis models could become very large in terms of memory footprint due to the caching of the I-splines by methodtools.lru_cache. In addition, the use of the methodtools caching made it impossible to pickle models for storage.

Now the usage of methodtools has been eliminated in favor of a simple dict caching implemented within the spline classes.

In addition, the epistasis models now clear their cache before pickling and (by default but optionally) after fitting. While this slightly increases the time to access results (as some things have to be re-calculated), it reduces memory footprint a lot in a way that should be worth it.

These changes will constitute version 0.4.1.