TestAssociation: Test association of a per-gene attribute with each column in...

Description Usage Arguments Examples

Description

Test the association of a per-gene attribute y with each column, where a column can represent a gene set, a motif, transcription factor targets, or other genes that are functionally related

Usage

1
TestAssociation(m, genes, y, method = "lasso", ...)

Arguments

m

A GeneMatrix object

genes

A vector of gene names (must match the gene names in the GeneMatrix)

y

A per-gene metric of the same length as the vector of gene names

method

Method used to test association between the per-gene metric and each column - either c("lasso", "t.test", "wilcoxon" or "hypergeometric")

...

Additional arguments that will be given to the test in question

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(org.Sc.sgd.db)

n_genes <- 200
genes <- sample(mappedkeys(org.Sc.sgdGO), n_genes)

mm <- GOMembershipMatrix(org.Sc.sgdGO, min_size = 5,
                       max_size = 50, chosen_genes = genes)
# some genes are dropped because they do not have GO categories

n_genes <- nrow(mm)
genes <- mm@geneData$ID

beta = c(20:1, rep(0, times = nrow(mm@colData)-20))
y = c(as.matrix(mm) %*% beta + rnorm(n_genes, 0, 2))

results <- TestAssociation(mm, genes, y)
View(results@colData)

dgrtwo/GSEAMA documentation built on May 15, 2019, 7:22 a.m.