Analyse drug set enrichment

analyseDrugSetEnrichment(
  sets,
  stats,
  col = NULL,
  nperm = 10000,
  maxSize = 500,
  ...,
  keyColSets = NULL,
  keyColStats = NULL
)

Arguments

sets

Named list of characters: named sets containing compound identifiers (obtain drug sets by running prepareDrugSets())

stats

Named numeric vector or either a similarPerturbations or a targetingDrugs object (obtained after running rankSimilarPerturbations or predictTargetingDrugs, respectively)

col

Character: name of the column to use for statistics (only required if class of stats is either similarPerturbations or targetingDrugs)

nperm

Number of permutations to do. Minimial possible nominal p-value is about 1/nperm

maxSize

Maximal size of a gene set to test. All pathways above the threshold are excluded.

...

Arguments passed on to fgsea::fgseaSimple

minSize

Minimal size of a gene set to test. All pathways below the threshold are excluded.

scoreType

This parameter defines the GSEA score type. Possible options are ("std", "pos", "neg")

nproc

If not equal to zero sets BPPARAM to use nproc workers (default = 0).

gseaParam

GSEA parameter value, all gene-level statis are raised to the power of `gseaParam` before calculation of GSEA enrichment scores.

BPPARAM

Parallelization parameter used in bplapply. Can be used to specify cluster to run. If not initialized explicitly or by setting `nproc` default value `bpparam()` is used.

keyColSets

Character: column from sets to compare with column keyColStats from stats; automatically selected if NULL

keyColStats

Character: column from stats to compare with column keyColSets from sets; automatically selected if NULL

Value

Enrichment analysis based on GSEA

See also

Other functions for drug set enrichment analysis: loadDrugDescriptors(), plotDrugSetEnrichment(), prepareDrugSets()

Examples

descriptors <- loadDrugDescriptors()
#> compound_descriptors_NCI60_2D.qs not found: downloading data...
drugSets <- prepareDrugSets(descriptors)

# Analyse drug set enrichment in ranked targeting drugs for a differential
# expression profile
data("diffExprStat")
gdsc      <- loadExpressionDrugSensitivityAssociation("GDSC")
#> expressionDrugSensitivityCorGDSC7.qs not found: downloading data...
#> Loading data from expressionDrugSensitivityCorGDSC7.qs...
predicted <- predictTargetingDrugs(diffExprStat, gdsc)
#> Subsetting data based on 11396 intersecting genes (85% of the 13451 input genes)...
#> Comparing against 266 GDSC 7 compounds (983 cell lines) using 'spearman, pearson, gsea' (gene size of 150)...
#> Comparison performed in 3.4 secs

analyseDrugSetEnrichment(drugSets, predicted)
#> Matching compounds with those available in drug sets...
#> Ordering results by column 'rankProduct_rank'; to manually select column to order by, please set argument 'col'
#> Columns 'name' and 'name' were matched based on 56 common values; to manually select columns to compare, please set arguments starting with 'keyCol'
#> Performing enrichment analysis...
#>                          descriptor         pval       padj         ES
#>   1:                 Small Rings: 4 0.0001031885 0.02930554 -0.6915988
#>   2:              Non-C/H Atoms: 11 0.0004355875 0.04501506 -0.7500000
#>   3:                   sp3-Atoms: 5 0.0004755112 0.04501506 -0.9037610
#>   4:              H-Donors: [6, 40] 0.0015030060 0.10671343  0.8880866
#>   5: Polar Surface Area: [123, 141] 0.0019976869 0.11346862 -0.6509521
#>  ---                                                                  
#> 280:               Non-C/H Atoms: 7 0.9234477218 0.93330659 -0.2876703
#> 281:       Electronegative Atoms: 7 0.9234477218 0.93330659 -0.2876703
#> 282:                 Small Rings: 3 0.9287048568 0.93529142 -0.2350154
#> 283:    Total Molweight: [294, 312] 0.9795073892 0.97950739 -0.5107143
#> 284:              Stereo Centers: 3 0.9795073892 0.97950739 -0.5107143
#>             NES nMoreExtreme size                                   leadingEdge
#>   1: -1.9388080            0   15   737754,752782,757441,1011,732517,759877,...
#>   2: -1.8822751            3    9 299933,330507,727989,745750,732517,759877,...
#>   3: -1.9310874            3    5                          174939,737754,752782
#>   4:  1.9611659            2    4                   125066,758612,759155,123127
#>   5: -1.7484034           18   12  174939,737754,752782,287459,63878,732517,...
#>  ---                                                                           
#> 280: -0.6489887         8045    6                                        706995
#> 281: -0.6489887         8045    6                                        706995
#> 282: -0.6510216         8948   14 299933,706995,683864,339555,606698,226080,...
#> 283: -0.6835170         4970    1                                        613327
#> 284: -0.6835170         4970    1                                        613327