Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/fetchCorrNetwork.R
from the input data e.g. normalized expression data, build the correlation network based on WGCNA.
Correlation coefficients, pvalues and relation directions are calculated using WGCNA functions cor
and corPvalueStudent
.
The correlation coefficients are continuous values between -1 (negative correlation) and 1 (positive correlation), with numbers close to 1 or -1, meaning very closely correlated.
datX and datY are matrices in which rows are samples and columns are entities.
1 | fetchCorrNetwork(datX, datY, corrCoef, pval, method, returnAs)
|
datX |
data frame containing normalized, quantified omics data e.g. expression data, metabolite intensities. Columns correspond to entities e.g. genes, metabolites, and rows to samples e.g. normals, tumors. Require 'nodetype' at the first row to indicate the type of entities in each column. See below for details. |
datY |
data frame containing normalized, quantified omics data e.g. expression data, metabolite intensities.
Use the same format as |
corrCoef |
numerical value to define the minimum value of absolute correlation, from 0 to 1, to include edges in the output. |
pval |
numerical value to define the maximum value of pvalues, to include edges in the output. |
method |
string to define which correlation is to be used. It can be one of "pearson","kendall","spearman", see |
returnAs |
string of output type. Specify the type of the returned network. It can be one of "tab","json","cytoscape". "cytoscape" is the format used in Cytoscape.js |
datX and datY are matrices in which rows are samples and columns are entities.
If datY is given, then the correlations between the columns of datX and the columns of datY are computed.
Otherwise if datY is not given, the correlations of the columns of datX are computed.
If grinn functions will be used in further analyses, the column names of both datX and datY are suggested to use grinn ids.
convertToGrinnID
is provided for id conversion, see convertToGrinnID
.
list of nodes and edges. The list is with the following componens: edges and nodes. Return empty list if found nothing
Kwanjeera W kwanich@ucdavis.edu
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
, http://js.cytoscape.org/
1 2 3 4 5 6 7 8 9 10 11 12 | # Compute a correlation network of metabolites
#dummy <- rbind(nodetype=rep("metabolite"),t(mtcars))
#colnames(dummy) <- c('G1.1','G27967','G371','G4.1',paste0('G',sample(400:22000, 28)))
#result <- fetchCorrNetwork(datX=dummy, datY=NULL, corrCoef=0.7, pval=1e-12, method="spearman", returnAs="tab")
#library(igraph)
#plot(graph.data.frame(result$edges[,1:2], directed=FALSE))
# Compute a correlation network of metabolites and proteins
#dummyX <- rbind(nodetype=rep("metabolite"),t(mtcars)[,1:16])
#colnames(dummyX) <- c('G1.1','G27967','G371','G4.1',paste0('G',sample(400:22000, 12)))
#dummyY <- rbind(nodetype=rep("protein"),t(mtcars)[,17:32])
#colnames(dummyY) <- c('P28845','P08235','Q08AG9','P80365',paste0('P',sample(10000:80000, 12)))
#result <- fetchCorrNetwork(datX=dummyX, datY=dummyY, corrCoef=0.7, pval=1e-4, method="spearman", returnAs="tab")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.