<p><em>Answer from @m, converted from comment:</em></p>
<p>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.</p>
<p>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.</p>
<p>Spearman correlation would be better than Pearson's you end up with a 2x2 matrix.</p>
<p><em>Answer from @peter-langfelder, converted from comment:</em></p>
<p>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.</p>

CC BY-SA 4.0
2021-05-17T04:42:03.467Z
2021-05-17T04:42:03.467Z
gringer
<p>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 <code>datExpr</code>.</p>
<p>I have the trait information in <code>datTraits</code> like below:</p>
<p><img src="https://i.sstatic.net/iwZ1U.png" alt="enter image description here" /></p>
<p>I totally got 20 modules named with different colors stored in <code>dynamicColors</code>. Like below I first calculated eigenvalues and then used it and trait information to check the association between Modules and trait data.</p>
<pre><code>MEs0 = moduleEigengenes(datExpr, dynamicColors)$eigengenes
MEs = orderMEs(MEs0)
moduleTraitCor = cor(MEs, datTraits, use = &quot;p&quot;);
moduleTraitPvalue = corPvalueStudent(moduleTraitCor, nSamples);
</code></pre>
<p>What is the optimal method to associate modules and trait using binary data?</p>
<ol>
<li><p>Is Pearson correlation a right way to check the association?</p>
</li>
<li><p>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.</p>
</li>
</ol>
<p>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.</p>

<r><rna-seq><networks><wgcna><correlation>
How to calculate module-trait relationship when trait data is in binary format?
# How to calculate module-trait relationship when trait data is in binary format?

(Asked by: username_0 on 2020-07-01)

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 = "p");
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.

**Tags:** r, rna-seq, networks, wgcna, correlation

---

## 1 answers

### Answer by username_1 on 2021-05-17. Score: 1

*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.


---

