stefpeschel / NetCoMi

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

minimum number of samples for net construct? #36

Closed iadamo1 closed 2 years ago

iadamo1 commented 2 years ago

Hi,

I am wondering whether you need a minimus number of samples when you run this: net_single <- netConstruct(amgut1.filt, filtTax = "highestFreq", filtTaxPar = list(highestFreq = 100), filtSamp = "totalReads", filtSampPar = list(totalReads = 1000), measure = "spring", measurePar = list(nlambda=10, rep.num=10), normMethod = "none", zeroMethod = "none", sparsMethod = "none", dissFunc = "signed", verbose = 3, seed = 123456) I have changed the nlamba and rep.num to 50 for my data.

The thing is I have four samples and then I get this message for my data: Error in netAnalyze(net_singlehal, clustMethod = "cluster_fast_greedy") : Network is empty.

Thanks a lot

stefpeschel commented 2 years ago

Technically, there's no minimum number of samples, however, from a statistical point of view, such small sample sizes are not meaningful. You won't get reliable association estimates with only a few samples.

The message "Network is empty" means that all estimated associations are zero after sparsification.

Also, Spring's built-in stability-based model selection approach is not meaningful for such small sample sizes. Setting rep.num to 50 means that 50 times, subsamples are taken and associations estimated. With only 4 samples, there is no variability in the subsamples.

Best, Stefanie

iadamo1 commented 2 years ago

Thanks for your reply! Yes, I actually merged the samples in order to be able to construct the network and have enough variability. I had also changed the nlamba and num.rep to higher values.