xgrau / placozoa-cell-type-evolution-code

Code for our work on cell type evolution in placozoans (Najle, Grau-Bové et al., Cell 2023)
5 stars 1 forks source link

cannot find ’jaccard‘ function #3

Closed jxxll closed 8 months ago

jxxll commented 8 months ago

cannot open file '../scripts/Cross_species_functions.R': No such file or directory

xgrau commented 8 months ago

The function you're trying to source will probably be in scripts/helper.R instead.

For future reference, please indicate context and which script were you running when you encountered this error.

jxxll commented 8 months ago

Thank you for your reply! I am running the s03_create_communities_2022-10-17.R script and encountered an issue. I found the jaccard_index function in scripts/helper.R, but I faced another problem. They belong to different modules, and I am thinking about how to solve this problem.

jac_ij = jaccard_index(spi_modog_m[shared_ogs,], spj_modog_m[shared_ogs,]) Error in intersect() at ../scripts/helper.R:407:8: ! x and y are not compatible. ✖ Different number of columns: 4 vs 5. Run rlang::last_trace() to see where the error occurred. spi_modog_m turquoise blue brown yellow VWF 1 0 0 0 ARPC1B 1 0 0 0 FLI1 1 0 0 0 ADGRL4 1 0 0 0

spj_modog_m[shared_ogs,] turquoise green yellow brown red VWF 1 0 0 0 0 ARPC1B 0 0 0 0 1 FLI1 1 0 0 0 0 ADGRL4 1 0 0 0 0 DCN 0 0 0 1 0

xgrau commented 8 months ago

The jaccard function this is calling was our own, and it was missing from the helper.R script. It should be solved now! Thanks for your eagle eye.