Make.adjacency.table: Computing an adjacency table

Description Usage Arguments Value Examples

View source: R/CoExpression.R

Description

This function is similar to Cor.square.matrix() and TOM.square.matrix() as it converts the square matrix into a 3 columns dataframe with no repeated pair of variables.

Usage

1

Arguments

data

Dataset of gene expression levels with genes in row and samples in columns

method

Methods to compute the correlation coefficients. "spearman" computes the Spearman's rho, "kendall" uses the Kendall's tau and "pearson" the Pearson's product moment correlation coefficient. These functions are called via the cor() function in the stats package. "TOM" uses the TOMsimilarityFromExpr() function from the WGCNA package.

Value

Datraframe of three columns. Two first contains pair of genes, and the third one the correlation coefficient or the TOM similarity.

Examples

1
2
3
4
5
6
7
8
9
# Creating a dataset
df = matrix(runif(500, 10, 100), ncol=20)
group = paste0(rep(c("control", "case"), each = 10),rep(c(1:10),each = 1))
genes <- paste0(rep(LETTERS[1:25], each=1))
colnames(df) = group
row.names(df) = genes

# computing correlation for pairs of genes with Spearman's rho
Adj = Make.adjacency.table(df,method = "spearman")

jtcasemajor/GENEXPRESSO documentation built on Dec. 21, 2021, 4:11 a.m.