ChiLiubio / meconetcomp

Compare microbial co-occurrence networks based on the trans_network class of microeco package
GNU General Public License v3.0
4 stars 0 forks source link

cal_sum_links function #8

Open Madi784 opened 4 months ago

Madi784 commented 4 months ago

I keep getting the same error with the cal_sum_links function. Since the unique edge labels are actually either "+" or "-", the problem doesn't seem to be related to unexpected characters in the edge labels. Do you have any ideas on this? Thank you very much!

t1$cal_sum_links(taxa_level = "Phylum") Error in t1$cal_sum_links(taxa_level = "Phylum") : Please check the edge labels! The labels should be + or - ! unique(t1$res_edge_table$label) [1] "+" "-"

ChiLiubio commented 4 months ago

Hi. Could you please attach your data t1 so that I can reproduce your issue? To save the t1, please follow the steps in the tutorial (https://chiliubio.github.io/microeco_tutorial/notes.html#save-function) and attach the compressed zip object. Please also attach your microeco package version.

Madi784 commented 3 months ago

Hi. Thanks for your prompt replay. I have attached the zip file here. The version of the microeco package I used is 1.3.0. Sum_Link.zip

ChiLiubio commented 3 months ago

Hi. I found it is a bug on the selection of ‘‘label’’ column on the res_edge_table. It can be temporarily solved by adding t1$res_edge_table %<>% .[, c(1, 2, 4, 3)] before running the following cal_sum_links function. Thanks. I also found the abundance in your otu_Conv_DNA_BS.txt is not count data. It is better to use count data instead of relative data for the input of SpiecEasi. Sum_Link_function_Madi.zip

Madi784 commented 3 months ago

Dear Chi Liu,

Thank you very much for your help! The code perfectly worked!