Closed andyjslee closed 9 months ago
This might lead to a higher memory usage but, alternatively, could you supply isoforms
to run_find_best_sites
?
def run_find_best_sites(isoforms, chrom):
...
from functools import partial
run_find_best_sites_worker = partial(run_find_best_sites, isoforms)
res = p.map(run_find_best_sites_worker, list(isoforms.keys()))
Thanks for using Flair, and especially for suggesting ways to improve it.
We're aware of the irritating complexity of running with map() inside a function. We're currently doing a major refactoring of Flair to make it easier to parallelize, so the need to implement your solution will hopefully no longer exist.
For now please change it in your own code. I'm moving this ticket to our Discussion section so others will be able to find it.
Thank you for developing your tool.
I was wondering if you could make the core logic inside
collapse_isoforms_precise.py
run inside a main entry point (i.e. move all of the code outside the functions intoif __name__ == '__main__':
). Depending on how you run FLAIR, I've noticed that the global variables such asisoforms
are not accessible inside the worker functions for multiprocessing if you don't provide the main scope.Thanks!