WGCNA package in R: dendogram plot error
0
0
Entering edit mode
16 months ago
Yawo • 0

**# Repeat the sample clustering together with a heat map of the phenotypic data

*jpeg("plotDendGSE10588.jpeg", width = 480, height = 480)
# Re-cluster samples
sampleTree2 = hclust(dist(datExpr), method = "average")
# Convert traits to a color representation: white means low, red means high, grey means missing entry
traitColors = numbers2colors(datTraits, signed = FALSE);
# Plot the sample dendrogram and the colors underneath.
plotDendroAndColors(sampleTree2, traitColors,
                    groupLabels = names(datTraits),
                    main = "Sample dendrogram and trait heatmap GSE10588")*****

Error in .plotOrderedColorSubplot(order = order, colors = colors, rowLabels = rowLabels, : Length of colors vector not compatible with number of objects in 'order'.

Any ideas on how to resolve this? Many thanks!

Note

(1) datExpr: contains 16 204 gene symbols X 43 samples

(2) datTraits: contains 23 clinical features in row X 4 variables in column

WGCNA R • 1.8k views
ADD COMMENT
0
Entering edit mode

datTraits: contains 2 clinical features in row X 4 variables in column

datTraits should have n rows as many samples you have

ADD REPLY
0
Entering edit mode

Dear Andres. Frrincieli,

Thank you. I am trying to replicate this following article: "Vidal MS Jr, Deguit CDT, Yu GFB, Amosco MD. G-Protein Coupled Receptor Dysregulation May Play Roles in Severe Preeclampsia-A Weighted Gene Correlation Network Analysis of Placental Gene Expression Profile. Cells. 2022 Feb 22;11(5):763. doi: 10.3390/cells11050763. PMID: 35269385; PMCID: PMC8909297".

I have performed different Network Analysis and observed that the gene expression matrix and clinical features (datTraits) contain the same and equal number of samples. However, it is not like in this article.

Any ideas on how to resolve this? Many thanks!

Yawo Ahonli

ADD REPLY
0
Entering edit mode

Hi Yawo,

Did you change the original message? If so, please don't do that.

What is the output of dim(datTrais) and dim(datExpr)?

ADD REPLY
0
Entering edit mode

Hi Andres,

Thank you. dim(datExpr) = 16204 obs. (gene symbols) X 43 variables (samples) dim(datTraits) = 24 obs. (clinical parameters) X 3 variables (severe preeclampsia, healthy control, and p-values).

I am trying to replicate the following article: "Vidal MS Jr, Deguit CDT, Yu GFB, Amosco MD. G-Protein Coupled Receptor Dysregulation May Play Roles in Severe Preeclampsia-A Weighted Gene Correlation Network Analysis of Placental Gene Expression Profile. Cells. 2022 Feb 22;11(5):763. doi: 10.3390/cells11050763. PMID: 35269385; PMCID: PMC8909297".

I observed that the clinical parameter matrix does not contain all the samples from the gene expression matrix. It is my first time facing this situation. This article used the average of all clinical parameters from the samples. I have managed to plot "Sample clustering to detect outliers.". However, I had an error in plotting the "dendrogram"

Any ideas on how to resolve this? Many thanks!

Yawo

ADD REPLY
0
Entering edit mode

I observed that the clinical parameter matrix does not contain all the samples from the gene expression matrix.

All samples in datTraits must be in datExpr. If you have 43 samples in datExpr then you must have 43 samples in datTraits.

I observed that the clinical parameter matrix does not contain all the samples from the gene expression matrix.

Because your datTraits is a table showing the results of a statistic test: severe preeclampsia vs healthy control. This is not how to use clinical data in WGCNA. You need a measure for each sample in datExpr. If you one of the clinical parameters is Birthweight (g), then you mast have 43 measures; one for each sample in datExpr

ADD REPLY
0
Entering edit mode

Dear Andres Firrincieli,

Thank you so much. But how has this article completed it?

Regards.

ADD REPLY
0
Entering edit mode

Hi Yawo,

The authors, as matter of fact, didn't use any of the clinical traits reported in Table S1. The only trait used was the severe preeclampsia (see Figure 2).

But how has this article completed it?

You don't need the trait data to perform a WGCNA analysis.

ADD REPLY

Login before adding your answer.

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