stefpeschel / NetCoMi

Network construction, analysis, and comparison for microbial compositional data
GNU General Public License v3.0
146 stars 26 forks source link

cores not working #40

Closed Cybernewbye closed 2 years ago

Cybernewbye commented 2 years ago

Good evening Dr. Peschel

First of all I would like to express our appreciation for your great work! I'm experimenting some issues about parallelization: e.g createAssoPerm(X, nPerm = 100, cores =3, computeAsso = FALSE, seed = 123456) still works on single core.

our OS is Ubuntu 20.04 R version 4.1.1 Rstudio version 2021.09.0 builid 351 parallel version 4.1.1 NetCoMi version 1.0.2

many thanks for your kind attention

Simone

Cybernewbye commented 2 years ago

I now observed a drastic elapsed time increase when switching from nPerm=20 to nPerm=21 (still on single core)

Cybernewbye commented 2 years ago

well, it seems that the matter is due to my sample number: in this step perm_group_mat <- t(sapply(1:(nPerm + 10), function(x) sample(groupvec))) perm_group_mat <- unique.matrix(perm_group_mat) the unique combinations available for 6 elements (my sample) are 20, no matter how many permutations I request. So the script doesn't have an exit.

stefpeschel commented 2 years ago

Dear Simone,

Thank you for using NetComi and for the information you provided.

I would need some time to check the single core issue on our server and will also have a look on the problem with low sample sizes. I'll get back with a solution by the end of the week.

Best, Stefanie

stefpeschel commented 2 years ago

Hey, I just uploaded a new version at 'develop' branch that fixes this issue. Sorry for the delay, I had to find a way to handle the matched design case.

If the given number of permutations exceeds the possible number of permutations, the function now returnes an error where the latter is printed. So, it's up to the user whether to do the network comparison with a smaller number of permutations or increase the sample size.

Could you please install the latest version from develop branch (version 1.0.2.9000) and let me know whether this workflow works for you?

The 'develop' branch version can be installed via: devtools::install_github("stefpeschel/NetCoMi", ref = "develop")

Best, Stefanie

Cybernewbye commented 2 years ago

many thanks!