Skip to contents

Replaces gene set results from paired up- and down- gene sets with the difference of the up-regulated genes and down-regulated genes

Usage

aggregateGeneSetScores(K2res, aggList)

Arguments

K2res

A K2 class object.

aggList

A named list where each item is a character vector of length, 2, comprising the name of the 'up' gene set, and the name of the 'down' gene set.

Value

An object of class K2.

References

Reed ER, Monti S (2021). “Multi-resolution characterization of molecular taxonomies in bulk and single-cell transcriptomics data.” Nucleic Acids Research. doi:10.1093/nar/gkab552 , https://pubmed.ncbi.nlm.nih.gov/34226941/. Hanzelmann S, Castelo R, Guinney J (2013). “GSVA: gene set variation analysis for microarray and RNA-Seq data.” BMC Bioinformatics, 14(1), 7. ISSN 1471-2105, doi:10.1186/1471-2105-14-7 , http://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-14-7.

Examples

## Read in ExpressionSet object
library(Biobase)
#> Loading required package: BiocGenerics
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
#>     as.data.frame, basename, cbind, colnames, dirname, do.call,
#>     duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#>     lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#>     pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
#>     union, unique, unsplit, which.max, which.min
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
data(sample.ExpressionSet)

## Pre-process and create K2 object
K2res <- K2preproc(sample.ExpressionSet)
#> No cohorts specified and clustFunc = 'cKmeansDownsampleSqrt' . Setting clustFunc = 'hclustWrapper'
#> No cohorts specified and recalcDataMatrix = TRUE. Setting recalcDataMatrix = FALSE
#> No cohorts specified and featMetric = 'F'. Setting featMetric = 'mad'

## Run K2 Taxonomer algorithm
K2res <- K2tax(K2res,
            stabThresh=0.5)

## Run differential analysis on each partition
K2res <- runDGEmods(K2res)
#> Running DGE for partition:
#>   1 / 10 
#>   2 / 10 
#>   3 / 10 
#>   4 / 10 
#>   5 / 10 
#>   6 / 10 
#>   7 / 10 
#>   8 / 10 
#>   9 / 10 
#>   10 / 10 

## Create dummy set of gene sets
DGEtable <- getDGETable(K2res)
genes <- unique(DGEtable$gene)
genesetsMadeUp <- list(
    GS1=genes[1:50],
    GS2=genes[51:100],
    GS3=genes[101:150])

## Run gene set hyperenrichment
K2res <- runGSEmods(K2res,
                genesets=genesetsMadeUp,
                qthresh=0.1)
#> Error in runGSEmods(K2res, genesets = genesetsMadeUp, qthresh = 0.1): could not find function "runGSEmods"

## Run GSVA on genesets
K2res <- runGSVAmods(K2res,
                ssGSEAalg='gsva',
                ssGSEAcores=1,
                verbose=FALSE)
#> Error in runGSVAmods(K2res, ssGSEAalg = "gsva", ssGSEAcores = 1, verbose = FALSE): could not find function "runGSVAmods"

## Aggregate paired gene sets
aggList <- list(c('GS12', 'GS1', 'GS2'))
K2res <- aggregateGeneSetscores(K2resaggList, K2res)
#> Error in aggregateGeneSetscores(K2resaggList, K2res): could not find function "aggregateGeneSetscores"