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"). By default ("std") the enrichment score is computed as in the original GSEA. The "pos" and "neg" score types are intended to be used for one-tailed tests (i.e. when one is interested only in positive ("pos") or negateive ("neg") enrichment).

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 2.86 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
#>                              <char>        <num>      <num>      <num>
#>   1:              Non-C/H Atoms: 11 0.0003260515 0.03086621 -0.7500000
#>   2:                 Small Rings: 4 0.0003088326 0.03086621 -0.6915988
#>   3:                   sp3-Atoms: 5 0.0001186521 0.03086621 -0.9037610
#>   4:              H-Donors: [6, 40] 0.0024378352 0.13846904  0.8880866
#>   5: Polar Surface Area: [123, 141] 0.0022177632 0.13846904 -0.6509521
#>  ---                                                                  
#> 280:               Non-C/H Atoms: 7 0.9286700414 0.93525635 -0.2876703
#> 281:       Electronegative Atoms: 7 0.9286700414 0.93525635 -0.2876703
#> 282:                 Small Rings: 3 0.9277195893 0.93525635 -0.2350154
#> 283:    Total Molweight: [294, 312] 0.9807118711 0.98071187 -0.5107143
#> 284:              Stereo Centers: 3 0.9807118711 0.98071187 -0.5107143
#>             NES nMoreExtreme  size  leadingEdge
#>           <num>        <num> <int>       <list>
#>   1: -1.8826139            2     9 299933, ....
#>   2: -1.9394290            2    15 737754, ....
#>   3: -1.9382045            0     5 174939, ....
#>   4:  1.9393394            4     4 125066, ....
#>   5: -1.7364593           20    12 174939, ....
#>  ---                                           
#> 280: -0.6501376         8071     6       706995
#> 281: -0.6501376         8071     6       706995
#> 282: -0.6497893         8945    14 299933, ....
#> 283: -0.6853264         4931     1       613327
#> 284: -0.6853264         4931     1       613327