JRaviLab / MolEvolvR

An R Package for characterizing proteins using molecular evolution and phylogeny
https://jravilab.github.io/MolEvolvR/
Other
6 stars 16 forks source link

InlP figures implementation #91

Open falquaddoomi opened 1 month ago

falquaddoomi commented 1 month ago

Description

This PR contains a very work-in-progress implementation of figures 2 and 3 from the InlP paper, https://www.microbiologyresearch.org/docserver/fulltext/mgen/8/7/mgen000828.pdf. The PR is intended as a starting point, so you don't have to go and find the original code from the papers, but it definitely needs a lot of work! See issue #88 for more details.

Closes #88.

What kind of change(s) are included?

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

valentina-buoro commented 1 month ago

Hi @epbrenner @jananiravi .

I tried running some files in the job results folder with the figure-generating code, and I'm getting an error Error in plan(strategy = plan, .skip = T) : could not find function "plan" . Searching the code for the plan function gave no results. Pls could you give me a pointer to what may be going on. The function I ran was inlp_fig2 .

jananiravi commented 1 month ago

@falquaddoomi @epbrenner could you look into this?

falquaddoomi commented 1 month ago

So, I'm not an R developer, so take this all with a grain of salt. Anyway...

@valentina-buoro, plan is from the future library; it basically tells R how to resolve "futures", functions that can be executed asynchronously (i.e., not in the main thread). Since it's in the future library, adding library(future) somewhere near the top of the file should resolve it.

I'm not sure why you're getting that message, though. The plan() invocation is almost certainly coming from another library, which is why you're not seeing it in the code, but I don't know enough about R to say whether the author of that library is correctly loading future or if that's the user's responsibility.

jananiravi commented 1 month ago

If we know for sure that we're invoking future::plan() best to call it explicitly to avoid any confusion. @the-mayer are we using future enough to warrant adding it as a dependency (to function imports)? Then even the library call upfront in this script might not be needed.

Thanks for addressing this, @falquaddoomi

valentina-buoro commented 1 month ago

Thank you @falquaddoomi @jananiravi

the-mayer commented 3 weeks ago

Another way to make sure all dependencies are loaded when working on a package is to run devtools::load_all(). This will attempt to load all MolEvolvR exported functions, as well as any declared imports. future::plan() is declared in the package NAMESPACE and thus would be loaded by a call to devtools::load_all()

valentina-buoro commented 3 weeks ago

Got it @the-mayer . Thank you