Error with hclust
1
0
Entering edit mode
@048777e0
Last seen 21 months ago
India

I'm new to the world of R, and have been facing this issue and nothing over the internet helped me solve it so am noting it down here.

Thank you for your help.

setwd("~/Desktop/IISc/Melaroma")

library(GEOquery)
my_id <- "GSE4843"
gse <- getGEO(my_id)
length(gse)
## [1] 1
gse <-gse[[1]]
gse

library(WGCNA)
options(stringsAsFactors = FALSE)

expression = as.data.frame(gse[, -c(1)]) 
expression = t(expression)
colnames(expression) = gse$EST
rownames(expression) = names(gse)[-c(1)]

sampleTree = hclust(dist(expression), method = "average")

Error in hclust(dist(expression), method = "average") : 
  NaN dissimilarity value.
In addition: Warning message:
In dist(expression) : NAs introduced by coercion
RNASeqR #hclust #wgcna #dissimilarity #average • 1.1k views
ADD COMMENT
1
Entering edit mode
ATpoint ★ 3.9k
@atpoint-13662
Last seen 16 hours ago
Germany

The proper getter function to get expression data from the ExpressionSet class is exprs() which gives probes as rows and samples as comlumns with colnames and rownames already parsed properly, so you only need that command here:

expression = exprs(gse)

Be sure to follow some sort of tutorial for the hclust part, there are some pitfalls to avoid.

ADD COMMENT
0
Entering edit mode

Thank you @ATpoint

can you suggest some good tutorials for WGCNA?

ADD REPLY

Login before adding your answer.

Traffic: 701 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