Description Usage References See Also
compute correlation coefficients, pvalues and relation directions from normalized data
using WGCNA::cor
and WGCNA::corPvalueStudent
to return outputs for further uses by
fetchCorrNetwork
, fetchDiffCorrNetwork
.
datX and datY are matrices in which rows are samples and columns are entities, require the first row to specify entity types e.g. metabolite.
If datY is given, then the correlations between the columns of datX and the columns of datY are computed.
Otherwise the correlations of the columns of datX are computed.
1 | getCorrAdjacency(datX, datY, method)
|
Langfelder P. and Horvath S. (2008) WGCNA: an R package for weighted correlation network analysis. BMC Bioinformatics, 9:559
Dudoit S., Yang YH., Callow MJ. and Speed TP. (2002) Statistical methods for identifying differentially expressed genes in replicated cDNA microarray experiments, STATISTICA SINICA, 12:111
Langfelder P. and Horvath S. Tutorials for the WGCNA package http://labs.genetics.ucla.edu/horvath/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/index.html
cor
, corPvalueStudent
, fetchCorrNetwork
, fetchDiffCorrNetwork
datMet = read.delim("~/grinn_sample/Lung_MET.txt", header=TRUE, stringsAsFactors=FALSE)
datPrt = read.delim("~/grinn_sample/Lung_PRT.txt", header=TRUE, stringsAsFactors=FALSE)
Convert kegg ids to grinn ids
grinnID = convertToGrinnID(txtInput=datMet$KEGG.id, nodetype="metabolite", dbXref="kegg")
grinnID = grinnID[!duplicated(grinnID[,1]),] #keep the first mapped id
internal function, called by apply for formatting ids
mapToInput = function(x)
id = which(grinnID$FROM_kegg == x[2])
out = ifelse(length(id)>0,as.character(grinnID$GRINNID[id]),x[1])
formatting input data
datMet = t(datMet)
colnames(datMet) = apply(datMet,2,mapToInput)
datMet = datMet[-c(1,2),]
formatting input data
datPrt = t(datPrt)
colnames(datPrt) = datPrt[1,]
datPrt = datPrt[-1,]
corAdj = getCorrAdjacency(datX=datMet, datY=datPrt, method="spearman")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.