shuangj00 / HARMONIES

A Hybrid Approach for Microbiome Networks Inference via Exploiting Sparsity
5 stars 5 forks source link

main.R Line 335 - sapply returning list instead of vector #4

Open aklobo opened 3 years ago

aklobo commented 3 years ago

I kept getting an error when trying to run HARMONIES and was able to find the line of code that was causing me problems -- in line 335 of 'main.R', sapply was returning 'name.idx' as a list instead of a vector, so in the next step where 'name.idx' is used to subset the abundance matrix it would throw an error.

If I use abundance.grp0 = abundance.ref0[unlist(name.idx),] in line 336, that fixes the issue.

I'm not sure if this could be related to the version of R I'm using to run HARMONIES, but I thought I'd share this here in case anyone else runs into this problem.