groupFisher: Fisher Exact Test for group enrichment analysis of...

View source: R/groupFisher.R

groupFisherR Documentation

Fisher Exact Test for group enrichment analysis of significant loadings

Description

This function generates the heatmap of qvalues from Fisher Exact Test of group enrichment analysis of sinigicant loadings.

Usage

groupFisher(data, loadings, qvalues, feature_groups, alpha, draw = T)

Arguments

data

Data matrix corresponding to the canonical loadings, samples are in rows, variables are in columns.

loadings

A named vector containing the estimated loadings.

qvalues

A vector containing qvalues for the canonical loadings.

feature_groups

A vector indicating the group information of variables.

alpha

Significance level, 0.05 by default.

draw

Whether draw the heatmap, default is TRUE.

Value

A vector containing the qvalues of fisher exact tests

Examples

library(TestPMD)
data("covid")
out <- PMA::CCA(standsdmu(covid$metabolite), standsdmu(covid$protein),
typex = "standard", typez="standard",
penaltyx = 0.9, penaltyz = 0.9, K = 3, standardize = FALSE, trace = FALSE)
pvalue <- CPTloading(X = covid$metabolite, Y = covid$protein, side = "X", K = 1, r = 10,
penalty = "Fixed", rho_x = 0.9, rho_y = 0.9, permutation_no = 100)
feature_groups <- c(rep("A", 61), rep("B", 50))
groupFisher(data = covid$metabolite, loadings = out$u[,1], qvalues = pvalue,
feature_groups = feature_groups, alpha = 0.1, draw = FALSE)

YunhuiQi/TestPMD documentation built on May 5, 2022, 8:23 p.m.