Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In functional-enrichment.Rmd and gene-patterns.Rmd, add config for turning on/off lazy caching #391

Open
menoldmt opened this issue Aug 16, 2023 · 1 comment

Comments

@menoldmt
Copy link
Contributor

Problem:

When Rds objects become too large, a lazy loading error will prevent functional enrichment and gene patterns from rendering.

Proposed Solution:


Add documentation to both files indicating that lazy caching will be disabled if the .Rds object is too big. Include the approximate size of the Rds object that prevented lazy loading from working here and here. This was tested and found to be: 
 
functional-enrichment.Rmd fails when combined.Rds (from rnaseq.Rmd):

232.87 mb<combined.Rds<241.90 mb.



functional-enrichment.Rmd tests on ‘combined.Rds’:                           

contrasts used in test data:
results 1-11 = 241.9mb check 1: fail
results 1-10 = 232.87mb check 1: pass
results 1-9 = 223.84mb check 1: pass
results 1-8 = 214.82mb check 1: pass 2: Pass
 



gene-patterns.Rmd tests on ‘combined_functional_enrichment.Rds’
 
results 1-9 = 2071mb check 1: fail
results 1-8 = needs further testing to confirm .Rds size limitation
 

In functional-enrichment.Rmd, add chunk before here that will test if the ‘combined.Rds’ object is over 230mb. If the .Rds object exceeds the threshold, set cache.lazy to FALSE in the 'enrich' chunk option like so:

 {r set_lazy_cache}
 rds_obj_limit_mb <- x
 if (file.info('combined.Rds')$size/(1000^2) > x) {
   cache.lazy=FALSE
 }
 else {
   cache.lazy=FALSE
 }

Add the same chunk before ‘finalclusters’ in gene-patterns here using the gene-patterns specific threshold that is still being determined as shown above.

 


@lillypi
Copy link

lillypi commented Feb 5, 2024

In order to use: cache.lazy=FALSE

Just place parameter into your preferred chunk's config. In LCDB-WF's functional enrichment Rmd, this would probably be the load chunk.

{r load, cache=TRUE, cache.lazy=FALSE, cache.extra=file.info('combined.Rds')$mtime}
code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants