Query regarding WGCNA module formation
0
0
Entering edit mode
3.5 years ago

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,

WGCNA RNA-seq • 823 views
ADD COMMENT
0
Entering edit mode

Hello,

The input data looks wrong:

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 

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.

ADD REPLY

Login before adding your answer.

Traffic: 1132 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6