I have been using the dynamic resource definition method with the binary operator { file.size() < CUTOFF ? choice1 : choice2 }
and have never tried to use more fine scale functions say using a custom groovy functions
memory { memneed = computeMemoryNeeded(file.size()); return memneed.GB }
The computeMemoryNeeded() function is defined globally in the nextflow script.
I am not sure such method will work or not. Theoretically, any method should work inside the closure.
Would like to get some comments and direction from you
Thanks for all the good work.