I came across with the qgraph package and I'm so grateful I did because I have got some many beautiful and informative plots. I am currently working with a larger database of 755 metabolites measured in 15 bacterial species at 2 time points and I a huge plot that I am unable to attach here because I do not have 10 reputation points.
I would like to see how the metabolites correlate among each other but I would like to see only the significant correlations. Therefore, I used the code that Sacha Epskam kindly provide in his website:
oralnet<-read.csv2('net24h.csv',dec='.')##file with the 755 metabolites
oralnet2<-oralnet[,2:756]##remove the first column with name of bacteria
namesnet<-read.csv2('netID.csv',dec='.') #file with the names of the bacteria
nameschars <- as.character(t(namesnet)[2:nrow(t(namesnet)),])
uniquechars <- unique(as.character(t(namesnet)[2:nrow(t(namesnet)),]))
nameslist<-list("Carbon" =which(nameschars==uniquechars[1]),
"Nitrogen"=which(nameschars==uniquechars[2]),
"PS"=which(nameschars==uniquechars[3]),
"Nutrient"=which(nameschars==uniquechars[4]),
"Peptide"=which(nameschars==uniquechars[5]))
rownames(oralnet2)<-c("Aa","Fn","Pg","Pi","Tf","Smut","Ssob","An","Csput","Sgord",
"Avisc","Ssal","Ssang","Vparv","Smitis")
qgraph(cor(oralnet2, use="pairwise"),minimum=0.25,groups=nameslist,
legend=TRUE,borders=FALSE,label.cex=0.4, labels=names(oralnet2),
layout="spring",line = 2.5,legend.cex=0.5,label.scale=FALSE,
graph="sig2",alpha=cc(0.0001,0.001))
As I mentioned, there are many correlations and I would like to remove some nodes. I know that qgraph does not allow you to remove nodes and therefore I was wondering if there is any way to improve the visualization of the plot. I will really appreciate any suggestion!! Once again, I thank you for your time and consideration!
Best wishes,
Emma