yuabrahamliu / CWGCNA

CWGCNA is an R package to perform causal inference from the WGCNA framework.
10 stars 1 forks source link

The code execution failed #3

Closed 123abclxy closed 3 weeks ago

123abclxy commented 1 month ago

Hello! When using your developed R package CWGCNA to analyze transcriptome data, I encountered two different situations. When I set balanceadj to TRUE, the result shows 'Start limma analysis on WGCNA modules Error in FUN(newX[, i], ...) : Cannot have NAs in the p-values! In addition: Warning message:executing %dopar% sequentially: no parallel backend registered.' When I set balanceadj to FALSE, the result shows 'Start limma analysis on WGCNA modules NULL Start limma analysis within WGCNA modules and mediation analysis Error in { : task 1 failed - "replacement has 0 rows, data has 159" In addition: Warning messages: 1: executing %dopar% sequentially: no parallel backend registered.' What are the reasons for these two situations and are there any solutions? Finally, is this method really suitable for transcriptome data analysis? I hope to receive your reply soon, thank you. Error-1 Error-2

yuabrahamliu commented 1 month ago

Can you show me the codes and data that trigger these errors? Without your codes and data, I don't have enough information.

But you could try setting the parameter threads to 1 and the parameter balanceadj to FALSE to see whether the error occurs again.

Yes, you can use it on transcriptomic data.

123abclxy commented 1 month ago

Thank you very much for your response. We have sent you the data and the running code via email. We hope you can assist us in resolving this issue. My intuition tells me that the birth of this package may replace the previously popular WGCNA and usher in a new era.

yuabrahamliu commented 1 month ago

I have updated the package. You can reinstall it and have a try. Please begin from the settings balanceadj = FALSE and threads = 1 to see whether it works this time.

123abclxy commented 1 month ago

Sorry to bother you again, but we've already used your modified R package and the problem still persists. Here's my code and a screenshot of the issue. library(devtools) install_github("yuabrahamliu/CWGCNA") library(CWGCNA) exprSet <- read.table(file = "复旦队列-表达.txt", sep = "\t", header = T, row.names = 1) betasgene=as.matrix(exprSet) pds<-read.table("复旦队列-临床资料.txt",header=TRUE,sep="\t") cwgcnares <- diffwgcna(dat = betasgene, pddat = pds, balanceadj= FALSE, responsevarname = "Stage", confoundings = NULL, featuretype = "gene", topvaricancetype = "sd", topvaricance = 5000, powers = seq(1, 20, 1), rsqcutline = 0.8, mediation = TRUE, topn = 1, plot = TRUE, titleprefix = "Placenta", labelnum = 5, titlesize = 17, textsize = 16, annotextsize = 5, pvalcolname = "adj.P.Val", pvalcutoff = 0.05, isbetaval = FALSE, absxcutoff = 0, diffcutoff = 0, threads = 1) Error Error

123abclxy commented 1 month ago

I have updated the package. You can reinstall it and have a try. Please begin from the settings balanceadj = FALSE and threads = 1 to see whether it works this time. Sorry to bother you again, but we've already used your modified R package and the problem still persists. Here's my code and a screenshot of the issue. library(devtools) install_github("yuabrahamliu/CWGCNA") library(CWGCNA) exprSet <- read.table(file = "复旦队列-表达.txt", sep = "\t", header = T, row.names = 1) betasgene=as.matrix(exprSet) pds<-read.table("复旦队列-临床资料.txt",header=TRUE,sep="\t") cwgcnares <- diffwgcna(dat = betasgene, pddat = pds, balanceadj= FALSE, responsevarname = "Stage", confoundings = NULL, featuretype = "gene", topvaricancetype = "sd", topvaricance = 5000, powers = seq(1, 20, 1), rsqcutline = 0.8, mediation = TRUE, topn = 1, plot = TRUE, titleprefix = "Placenta", labelnum = 5, titlesize = 17, textsize = 16, annotextsize = 5, pvalcolname = "adj.P.Val", pvalcutoff = 0.05, isbetaval = FALSE, absxcutoff = 0, diffcutoff = 0, threads = 1) ![Uploading Error.png…]()