Intramodular Connectivity in WGCNA: row names and NAs
1
0
Entering edit mode
4 months ago
rependo ▴ 40

Hi all,

I'm using WGCNA for network analysis (blockwiseModules) and intramodularConnectivity.fromExpr to get kWithin values for all genes going into the network. I'm running into a small issue in that intramodularConnectivity.fromExpr drops row/gene names. I'm using column names from the original count matrix to fill in, but I'm unsure if the order of genes is maintained and thus I'm a little uncomfortable using it as a work-around.

Is anyone familiar enough with intramodularConnectivity.fromExpr to suggest a way to maintain row names in its output, or with WGCNA to confirm that the order of genes is maintained (and thus my work around is valid)?

And a tangentially related question, I'm using corFnc = "bicor" for intramodular connectivity and noticing some genes have NA kWithin values. Is this to be expected? I don't get NA values when I use a different approach to get connectivity values (making an adjacency matrix with abs(cor()) followed by intramodularConnectivity()

Many thanks.

WGCNA • 302 views
1
Entering edit mode
4 months ago

I never encountered these kinds of problems because I never used the blockWise approach. I usually follow the step-by-step procedure.

I'm using column names from the original count matrix to fill in, but I'm unsure if the order of genes is maintained and thus I'm a little uncomfortable using it as a work-around.

The order of gene is maintained unless the argument checkMissingData = TRUE removed genes with too many missing values or zero variance.

And a tangentially related question, I'm using corFnc = "bicor" for intramodular connectivity and noticing some genes have NA kWithin values. Is this to be expected? I don't get NA values when I use a different approach to get connectivity values (making an adjacency matrix with abs(cor()) followed by intramodularConnectivity()

I don't think this is caused by the utilization of the corFnc = "bicor". More likely, this has to do with the blockWise approach used to build the network and detect the modules. However, without the original data, I can't confirm this.

Do a favor to yourself, If you have enough RAM follow the step-by-step procedure

edit: Follow-up response to the question

And a tangentially related question, I'm using corFnc = "bicor" for intramodular connectivity and noticing some genes have NA kWithin values. Is this to be expected?

This is caused by the softConnectivity function used in intramodularConnectivity.fromExpr. NAs are introduced for genes that are not expressed in at least:

minNSamples = max(..minNSamples, nSamples/3)


where the default value for ..minNSamples is 4 and nSamples is the total number of samples in datExpr. In the WGCNA tutorial FemaleLiver (3600 genes and 134 samples) minNSamples is equal to

> max(4, 134/3)
[1] 44.66667


And the intramodularConnectivity.fromExpr will print the following message:

Kin<-intramodularConnectivity.fromExpr(datExpr, mergedColors)
# softConnectivity: FYI: connecitivty of genes with less than 45 valid samples will be returned as NA.
# ..calculating connectivities....100%

0
Entering edit mode

Thanks so much, Andres. This is hugely helpful.