Hello,
am trying to learn co-occurrence analysis for microbial data. I got relative abundance at the genera level for 50 genera in 19 samples.
I understand that for network analysis first I need to do Spearman's correlation analysis and P-value calculation and after that, I need to do filtering based on these two criteria value and then I need to visualize the network in Cytoscape.
But I am not sure how I can do filtering based on spearman's correlation and P-value altogether and in which format should I save the file for Cytoscape input?
Here is the code and data file by dput command;
Rcode;
library(vegan)
library(phyloseq)
library(ggplot2)
library(magrittr)
library(dplyr)
library(reshape2)
library(RColorBrewer)
library(readxl)
library(corrplot)
library("PerformanceAnalytics")
library("Hmisc")
library(psych)
list.files()
A <- readxl::read_excel("soil.test.wet.count.xlsx")
dput(A)
# Convert the first column to be row names
B <- A[, -1]
C <- data.frame(B, row.names=A$Sample)
M = as.matrix(C)
#View(M)
#-------------------------------------spearman---------------------------------------------#
cor_5 <- rcorr(as.matrix(M),type=c("spearman"))
r_mat <- cor_5$r
p_mat <- cor_5$P
write.table(r_mat, "r.correlation.txt")
write.table(p_mat, "pvalues.txt")
Many thanks,
Yogesh
--
You received this message because you are subscribed to a topic in the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cytoscape-helpdesk/xi5Ir03dpXo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cytoscape-helpd...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/bafee5b4-6f91-4439-bade-705aa73a1ca8n%40googlegroups.com.