Error: non-numeric matrix extent in pickSoftThreshold.fromSimilarity, WGCNA
0
0
Entering edit mode
MartinRK • 0
@martinrk-20369
Last seen 5.6 years ago
Ann Arbor

Hi everyone:

I want to conduct WGCNA on paired samples. I first filter out the genes that have no expression in both samples, then calculate the correlation using Spearman method and assign 0 to NA value in the correlation matrix.

count<-0
for(i in 1:nrow(NN_expr)){
  if(sum(NN_expr[i,])+sum(PP_expr[i,])==0){
    count<-c(count,i)
  }
}
count<-count[-1]
non_zero_NN<-NN_expr[-count,]
non_zero_PP<-PP_expr[-count,]

non_zero_NN<-t(as.matrix(non_zero_NN))
non_zero_PP<-t(as.matrix(non_zero_PP))
NN_cor<-cor(non_zero_NN,method = "spearman")
PP_cor<-cor(non_zero_PP,method = "spearman")
NN_cor[is.na(NN_cor)]<-0.00
PP_cor[is.na(PP_cor)]<-0.00

However, when I use the curated correlation matrix as the input of the function pickSoftThreshold.fromSimilarity, it has the error:

# choose a set of soft-threshold powers
powers=c(c(1:10),seq(from= 12 ,to = 20,by = 2))
#calculate soft-threshold 
sft<-pickSoftThreshold.fromSimilarity(NN_cor,RsquaredCut=0.85,powerVector=powers, removeFirst=FALSE,nBreaks=10,blockSize=1000,moreNetworkConcepts=FALSE,verbose=0,indent=0)


Error in { : task 1 failed - "non-numeric matrix extent"
Calls: pickSoftThreshold.fromSimilarity -> pickSoftThreshold -> %dopar% -> <Anonymous>
Execution halted

Does anyone have any idea how to solve this problem? Thank you so much!

WGCNA • 962 views
ADD COMMENT

Login before adding your answer.

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