timpeters82 / DMRcate-devel

devel git for DMRcate
Other
7 stars 8 forks source link

Speeding up functions #10

Open lkhilton opened 2 months ago

lkhilton commented 2 months ago

Thank you for writing this excellent package with great support for EPICv2 arrays.

I've noticed that a lot of functions load the EPICv2 manifest from cache. This can be really slow - for example as I iterate over my list of DMRs and plot them with DMR.plot, each iteration of the function loads the manifest again. Would it be possible to load the manifest once in my script, and make it an option to provide the pre-loaded manifest as an argument to each function?

timpeters82 commented 2 months ago

Hi Laura,

Thanks, you're right it was a bit slow and so I've made it a bit more streamlined in the last few commits. When calling DMR.plot() from the latest version (3.0.9), you'll notice you can now pass a CpGannotated object (in addition to the old functionality with a beta matrix / bsseq object) that already contains the CpG coordinates, which makes the computation a lot faster.

Cheers, Tim

lkhilton commented 2 months ago

Ah, thanks, Tim! I had just installed 3.0.9 but had missed this detail in the documentation. I'll give it a whirl.