ChiLiubio / mecodev

A set of extended classes based on the microeco package
GNU General Public License v3.0
4 stars 1 forks source link

Chord Diagram #1

Open alberjo296 opened 2 years ago

alberjo296 commented 2 years ago

Hi Chi,

I never have done a Chord Diagram and I wanted to know: the represented correlations are positive correlations? (I mean, they indicate the presence of one Phylum in presence of another, isn't it? So there are not negative correlations (presence of a Phylum in absence of other)).

I wanted also to know if you could please check if the parameters I established are considered as "normals" because I've been reading a little of bibliography but I'm not sure:

t50 <- trans_network$new(dataset = dataset, cal_cor = "WGCNA", taxa_level = "OTU", cor_method = "spearman", filter_thres = 0.0001) t50$cal_network(p_thres = 0.05, COR_cut = 0.6) test1 <- trans_netchord$new(dataset = t50, taxa_level = "Phylum") test1$plot_sum_links(plot_pos = TRUE, plot_num = 15)

I have seen many people establish the correlation coefficient threshold in 0.6 but I'm not sure of what it means and what are considered as ordinary values ¿?. The p_thres = 0.05 is referred to Spearman? Is it okay to be 0.05?

Then, what do the numbers in the edge of the diagram represent? The number of OTUs from which each phylum correlates??

What can I do if I don't want to show the Phylum "Unassigned" in my diagram? Or if I want to select for example only 15 specific phyla that are not the ones that appear by default?

Is there any way in this graph (or maybe in other) I can instead of correlating bacteria with themselves, correlate it with another variable; i.e. a treatment? Is there also any way to obtain the positive and negative correlations among bacteria (with green and red for example color representation)?

Sorry, I know they are so many questions, but I'm sooo curious :)

ChiLiubio commented 2 years ago

Hi @alberjo296

The represented correlations you use are positive correlations as plot_pos = TRUE in plot_sum_links. If FALSE, the plot show all the negative correlation. So these links just represent the connection numbers for either positive or negative. Is it clear?

I checked it out and does not find something abnormal. You can also check the files if you are interested in those details in the file stored in the object.

R = 0.6 generally represents the so-called threshold of strong correlation (maybe also 0.7). But it just represent a threshold. We should be cautious to infer other things based on the correlations.

The numbers in the edge of diagram represent the numbers of connections between A and B. More means more links between the species in the two phylum. Yes. You got it! it is the number.

In this case, you can modify the file res_sum_links_pos stored in your test1 object (your trans_netchord object). Please see the help document for the Return part. The next plotting is based on this or another res_sum_links_neg. You can delete something you donot require.

I am a little confused about this ploting issue as the correlations may be done using many samples from different treatments. It is feasible to add variables directly in the network construction and ploting. This correlation means the network visualization in gephi ? It is easy to use gephi panel to assign colors for different edge type, i.e. pos and neg. Please feel free to tell me if I miss something.

Best Chi