Entering edit mode
6.2 years ago
giuseppe0525
▴
20
Hi,
An error occurred to me when I used the function recutBlockwiseTrees of WGCNA package. The error message is:
> blockwiseModules: cutreeDynamic returned the following error:
> Error in cutreeDynamic(dendro = dendrograms[[blockNo]], deepSplit = deepSplit, : Argument dendro must have class hclust.
However, the class of dendro is indeed correct, as is shown:
> class(net$dendrograms[[1]])
> [1] "hclust"
I used the following codes:
> net <- recutBlockwiseTrees( datExprPFC,
> good_Samplegenes$goodSamples, good_Samplegenes$goodGenes, rep(1,
> times=ncol(datExprPFC)), "total_blockwiseTOM-block.1.RData",
> **net$dendrograms[[1]]**, corType = "bicor", networkType = "signed",
> deepSplit = 4, detectCutHeight = 0.99, minModuleSize = min(20,
> ncol(datExprPFC)/2 ), maxCoreScatter = NULL, minGap = NULL,
> maxAbsCoreScatter = NULL, minAbsGap = NULL, minSplitHeight = NULL,
> minAbsSplitHeight = NULL, useBranchEigennodeDissim = FALSE,
> minBranchEigennodeDissim = mergeCutHeight, pamStage = TRUE,
> pamRespectsDendro = TRUE, minCoreKME = 0.5, minCoreKMESize =
> minModuleSize/3, minKMEtoStay = 0.3, reassignThreshold = 1e-6,
> mergeCutHeight = 0.15, impute = TRUE, trapErrors = FALSE,
> numericLabels = FALSE, verbose = 0, indent = 0)
Previously, I ran these codes to create the associated objects, and there's nothing wrong.
> net = blockwiseModules(
> datExprPFC,
> loadTOM = FALSE,
> corType="bicor",
> networkType="signed", power=12,
> maxBlockSize=50000,
> minModuleSize=30, pamRespectsDendro=FALSE,
> mergeCutHeight=mergingThresh,
> numericLabels=TRUE,
> TOMType = "signed", saveTOMs=TRUE,
> saveTOMFileBase="total_blockwiseTOM",
> nThreads = 8)
The R environment is 3.5.0 on x86_64-redhat-linux-gnu (64-bit).
Do you know what might cause the error? Thank you!
How does your network actually appear prior to recutBlockwiseTrees?, i.e., plot the dendrogram
Thanks for your reply. That's a weird plot where the majority of the genes don't fall into any module, and that's why I want to re-cut the trees. The plot was build on a single-cell RNA-seq dataset containing around 2,000 cells. The input genes were transformed to TPM and log2(x+1) transformed.! The plot is linked here. enter image description here
That looks very 'atypical', which may indirectly be the cause of the error...
You may consider trying to do some pre-processing of the data before WGCNA, such as removing samples with a high number of NA values and / or those with many genes of low expression.
Unfortunately, it didn't work. I have filtered many samples with many low expressed genes and the dendrogram looks similar. Have you done WGCNA on single-cell RNA-seq data? Is there any difference that I should pay attention to? Maybe I missed something.
Okay, can you explain the processing that you performed prior to WGCNA? - normalisation,. transformation(s), et cetera? I have worked with scRNA-seq data, but never with WGCNA.
Generally, your data-points look 'too similar', which renders your clustering 'flat' and not amenable to a network analysis.
Sure. The data has been transformed to TPM. What I performed was: 1. filter samples with many genes with low expression; 2. log2(x+1) transformation; 3. quantile normalisation.
The codes I used were shown below:
Additionally, I tried removing the 'bad samples' while not doing log2 and quantile transformation, and the dendrogram shows that slightly more genes were clustered. However, the majority were labeled grey.
Hi, but it does not really make sense to quantile normalise after you have log-transformed the data. From where does ExprData derive?
I got ExprData here. I want to test whether WGCNA can be performed on sc-RNA-seq data.
Hi! Well, there lies the issue. That file already contains TPM, which is already normalised. For WGCNA, just use the logged TPM data. You do not have to perform quantile normalisation.
Thanks for suggestion. But unluckily, It didn't work. I skipped the quantile normalisation step and the cluster dendrogram looks similar. It seems it is the data issue.
You can try without logging, too. WGCNA is based on correlation, so, the data does not strictly have to be logged. Even the authors state this.
Yes, I did try and the plot was similar. Maybe I can try the variance Stabilizing Transformation included in DESeq2, which takes a lot of time.
Variance stabilisation should, actually, be quick. It is rlog that can take a long time.
As a final suggestion, perhaps you could convert the TPM data to Z-scores, and then try WGCNA. Not ideal at all, but TPM data is neither ideal starting off.
Thanks for your suggestion.
What happened to your analysis, giuseppe0525?
Having some issues, rodd?
Hi, have you fixed it? I met the same problem.