Hi Biostars community,
As a trait of interest, I use the categorical variable "trait" coded by 0/1 for Normal/Tumor tissue samples respectively. I have a matrix of expression data (Normalized and variance stabilized data) per gene (1900 genes) per sample (I've 22 Normal samples and 22 Tumor samples). I have also the trait data matrix with two column: sampleName and traitValue (0 for normal sample or 1 for tumor sample). I'm interesting to highlight modules in both Normal and Tumor status using WGCNA.
What I have already achieved:
- from the trait data matrix, I extracted a matrix of normal samples only (in this case, the traitValue=0 for all the 22 samples), and another matrix for the tumor samples only (in this case, the traitValue = 1 for all the 22 samples).
- from the expression data, I have formed two matrices of expression data (the first contains the normal samples, and the second the tumor samples)
- I have already detected modules in both sample groups.
When I try to identify the correlation (and significance p_value) between the modules and the trait within each sample group using the following command:
moduleTraitCorrelation = cor(MEs, datTraits, use = "p");
since the datTraits variable represents a vector of equal values (0:normal, 1:tumor) so absence of variance, I get NA values in the resulted correlation matrices (one column represents module names, and another the correlation values)
any idea ?