Bootstrap the AUC and conduct T-Tests for a collection of signatures.
Source:R/bootstrap.R
bootstrapAUC.Rd
Run bootstrapping of the AUC and derive the p-value for a 2-sample t-test for all signatures tested on a given dataset.
Usage
bootstrapAUC(
SE_scored,
annotationColName,
signatureColNames,
num.boot = 100,
pb.show = TRUE
)
Arguments
- SE_scored
a
SummarizedExperiment
object with genes as the row features and signature scores in thecolData
. There should also be a column of annotation data. Required.- annotationColName
a character string giving the column name in
colData
that contains the annotation data. Required.- signatureColNames
a vector of column names in the
colData
that contain the signature score data. Required.- num.boot
integer. The number of times to bootstrap the data. The default is
100
.- pb.show
logical for whether to show a progress bar while running code. The default is
TRUE
.
Value
A list of length 5 returning a vector of p-values for a 2-sample
t-test, bootstrapped AUC values, an AUC value for using all scored values
for all signatures specified in signatureColNames
,
and values for the lower and upper bounds of a bootstrapped AUC confidence
interval using pROC::roc()
.
Examples
# Run signature profiling
choose_sigs <- list("madeupsig" = c("FCRL3", "OAS2", "IFITM3"))
prof_indian <- runTBsigProfiler(TB_indian, useAssay = "logcounts",
algorithm = "ssGSEA",
combineSigAndAlgorithm = TRUE,
signatures = choose_sigs,
parallel.sz = 1)
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#>
#> Attaching package: ‘MatrixGenerics’
#> The following objects are masked from ‘package:matrixStats’:
#>
#> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#> colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#> colWeightedMeans, colWeightedMedians, colWeightedSds,
#> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#> rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#> rowWeightedSds, rowWeightedVars
#> Loading required package: GenomicRanges
#> Loading required package: stats4
#> 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
#> Loading required package: S4Vectors
#>
#> Attaching package: ‘S4Vectors’
#> The following object is masked from ‘package:utils’:
#>
#> findMatches
#> The following objects are masked from ‘package:base’:
#>
#> I, expand.grid, unname
#> Loading required package: IRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: Biobase
#> Welcome to Bioconductor
#>
#> Vignettes contain introductory material; view with
#> 'browseVignettes()'. To cite Bioconductor, see
#> 'citation("Biobase")', and for packages 'citation("pkgname")'.
#>
#> Attaching package: ‘Biobase’
#> The following object is masked from ‘package:MatrixGenerics’:
#>
#> rowMedians
#> The following objects are masked from ‘package:matrixStats’:
#>
#> anyMissing, rowMedians
#> Parameter update_genes is TRUE. Gene names will be updated.
#> Running ssGSEA
#> Warning: 1 genes with constant values throughout the samples.
#> [1] "Calculating ranks..."
#> [1] "Calculating absolute values from ranks..."
#> [1] "Normalizing..."
# Bootstrapping
booted <- bootstrapAUC(SE_scored = prof_indian, annotationColName = "label",
signatureColNames = names(choose_sigs), num.boot = 2)
#>
|
| | 0%
|
|======================================================================| 100%
booted
#> $`P-values`
#> [1] 2.458101e-05
#>
#> $`Boot AUC Values`
#> madeupsig
#> 1 0.7284211
#> 2 0.8636364
#>
#> $`Non-Boot AUC Values`
#> [1] 0.8484211
#>
#> $`pROC Lower`
#> [1] 0.7347
#>
#> $`pROC Upper`
#> [1] 0.9621
#>