stefpeschel / NetCoMi

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

Network is empty when trying to netAnalyze() #47

Closed Rob-murphys closed 2 years ago

Rob-murphys commented 2 years ago

I am running a network with the following command which follows many of the settings you put in your tutorial:

net_single = netConstruct(cazyme_profile_reshape,
                          filtTax = "none",
                          filtSamp = "totalReads",
                          filtSampPar = list(totalReads = 1000),
                          measure = "spring",
                          measurePar = list(nlambda=50, 
                                            rep.num=50),
                          normMethod = "none", 
                          zeroMethod = "none",
                          sparsMethod = "none", 
                          dissFunc = "signed",
                          verbose = 3,
                          seed = 123456)

The input dataframe is:

> dim(cazyme_profile_reshape)
[1] 1689   25

When I try to analyse the network with netAnalyze() I get the following error:

Error in netAnalyze(net_single, centrLCC = TRUE, clustMethod = "cluster_fast_greedy",  : 
  Network is empty.

Would you have any insight as to why this is occurring? Is it perhaps because I am not filtering taxa?

stefpeschel commented 2 years ago

Hey,

The "Network is empty" message means that no associations have been detected by the SPRING method.

You may try increasing SPRING's threshold parameter to get a denser network, e.g.:

net_single = netConstruct(... ,
                          measurePar = list(thresh = 0.2,                           
                                            nlambda=50, 
                                            rep.num=50))

The default value is 0.1 (see ?SPRING::SPRING for the documentation of SPRING(), which is called internally if you set the measure parameter to "spring").

Best, Stefanie

Rob-murphys commented 2 years ago

Hi Stefanie,

Thanks for the response, I will try increasing the threshold. It is curious that no associations have been detected. The data I am putting in is not exactly typical. It is the absolute abundance (within a sample) of certain enzymes taken from the mapping depth.

My samples come from three very distinct time points that represent large biological shifts in the system I work in. Would it be better to present each group of samples separately to NetCoMi or is including them all in one network okay?

Best, Lamma

stefpeschel commented 2 years ago

Dear Lamma, Sorry, I completely forgot to respond. Combining taxa of multiple time points into one network is meaningful if you are interested in whether the abundances of different time points are associated. However, since the questions whether to include all data into one network or construct several networks depends on your research question, I can't give any advice here. Best, Stefanie