How to calculate module-trait relationship when trait data is in binary format? I have a dataset of 50 breast cancer samples. These samples are classified into four subtypes Lum A, Lum B, Her2 and Basal. I have been working with lncRNAs and protein-coding genes. To identify the functions of lncRNAs, I have used WGCNA through which I get the modules with protein-coding genes and lncRNAs. The expression data is stored in a matrix datExpr.
I have the trait information in datTraits like below:

I totally got 20 modules named with different colors stored in dynamicColors. Like below I first calculated eigenvalues and then used it and trait information to check the association between Modules and trait data.
MEs0 = moduleEigengenes(datExpr, dynamicColors)$eigengenes
MEs = orderMEs(MEs0)
moduleTraitCor = cor(MEs, datTraits, use = &quot;p&quot;);
moduleTraitPvalue = corPvalueStudent(moduleTraitCor, nSamples);

What is the optimal method to associate modules and trait using binary data?

Is Pearson correlation a right way to check the association?

Is there any other way to check the association between modules and trait (which represented like above in binary)? Details of methology would be welcome.


Patients are not genetically related and I have no information on environmental risk factors. I was thinking about logistic regression, but before doing that, I would like to take suggestions.
Answer from @m, converted from comment:
Personally I'd build a tree. Whats your question patients or the relationship between RNAseq 'signatures'? Its not the definitive analysis, but its good mining.
Pearson is doable but how many Pearson's? You'll end up with a 2x2 matrix. How will you resolve the matrix clustering? A maximum likelihood phylogeny solution would work here making use of the binary format. There are other approaches.
Spearman correlation would be better than Pearson's you end up with a 2x2 matrix.
Answer from @peter-langfelder, converted from comment:
You can use Pearson correlation, it is equivalent to carrying out an equal-variance t-test for the module eigengene between the two groups specified by the binary variable.