Entering edit mode
3.5 years ago
microorganism_001
▴
30
I am trying to make a co-expression module with the following input gene-set associated standard division into a csv file and R-code but I'm getting error at the point of creating similarity matrix.- I first used
Geneid Standard_Deviation
TEA_015735 136871.105296187
TEA_021485 90055.8355925799
TEA_008699 52986.1997835285
TEA_006622 52363.8854613665
TEA_024055 46407.075185256
TEA_020597 33511.1751584453
TEA_028572 29998.4692072409
TEA_001699 27893.7930167468
TEA_001579 25183.9331177197
workingData = read.csv("gene_count_matrix _sd.csv", header = T, row.names =1)
cordist <- function(dat) {
cor_matrix <- cor(t(dat))
dist_matrix <- as.matrix(dist(dat, diag=TRUE, upper=TRUE))
dist_matrix <- log1p(dist_matrix)
dist_matrix <- 1 - (dist_matrix / max(dist_matrix))
sign(cor_matrix) * ((abs(cor_matrix) + dist_matrix)/ 2)
}
sim_matrix <- cordist(workingData)
Error is following in R studio -
Error in cor(t(dat)) : 'x' has a zero dimension.
For reference, I Have installed the following libraries in R studio-
WGCNA,
knitr,
reshape2,
limma,
gplots,
ggplot2,
RColorBrewer,
Hello,
The input data looks wrong:
To compute a similarity matrix you would need a matrix of normalized and log2 transformed gene expression vaues. If this is the first time you approach WGCNA, I suggest you go through the WGCNA tutorials instead of following some random guide in github.