This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to contrast two networks with WGCNA in R?

Hi, I want to contrast 2 sets of expression data obtained by microarray. I am following the tutorial by Miller (https://labs.genetics.ucla.edu/horvath/CoexpressionNetwork/WORKSHOP/2013/Miller/Miller1_ComparingMouseAndHumanBrain.pdf), and it served my purpose well, up until the point on slide 14, where Miller find common hub genes with this code:

Gene = rownames(datExprA1g)
topGenesKME = NULL
for (c in 1:length(colorsA1)){
 kMErank1 = rank(-geneModuleMembership1[,c])
 kMErank2 = rank(-geneModuleMembership2[,c])
 maxKMErank = rank(apply(cbind(kMErank1,kMErank2+.00001),1,max))
 topGenesKME = cbind(topGenesKME,Gene[maxKMErank<=10])
}; colnames(topGenesKME) = colorsA1
topGenesKME

He then adds that it is possible to find genes unique to a single network by taking the difference in ranked kME instead of the maximum.

I wonder if any experts out there might be able to help me with the code that produce a list of genes that are unique to e.g. expression set A1.

Thank you for your help. Sincerely, Jimmy

r wgcna

1 answer

Solved :D can close this now

Please do not delete questions when you get a solution - share the solution instead. The community can benefit from your experience that way.

Log in to answer this question.