GSEA
gseaRes_all <- vector(mode = "list", length = length(validated_ind))
names(gseaRes_all) <- paste0("PCcluster_", validated_ind)
for (i in seq_along(validated_ind)) {
res <- msigdb_gsea(validated_ind[i], PCAmodel, category = "C2")
gseaRes_all[[i]] <- res
}
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
##
## clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
## clusterExport, clusterMap, parApply, parCapply, parLapply,
## parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:dplyr':
##
## combine, intersect, setdiff, union
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## anyDuplicated, append, as.data.frame, basename, cbind, colnames,
## dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
## grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
## order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
## rbind, Reduce, rownames, sapply, setdiff, sort, 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")'.
##
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
##
## first, rename
## The following object is masked from 'package:PCAGenomicSignatures':
##
## metadata
## The following object is masked from 'package:base':
##
## expand.grid
##
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
##
## collapse, desc, slice
##
## Attaching package: 'AnnotationDbi'
## The following object is masked from 'package:dplyr':
##
## select
##
## Excluded 1444 from.IDs without a corresponding to.ID
## Registered S3 methods overwritten by 'clusterProfiler.dplyr':
## method from
## arrange.compareClusterResult clusterProfiler
## arrange.enrichResult clusterProfiler
## arrange.gseaResult clusterProfiler
## filter.compareClusterResult clusterProfiler
## filter.enrichResult clusterProfiler
## filter.gseaResult clusterProfiler
## group_by.compareClusterResult clusterProfiler
## group_by.enrichResult clusterProfiler
## group_by.gseaResult clusterProfiler
## mutate.compareClusterResult clusterProfiler
## mutate.enrichResult clusterProfiler
## mutate.gseaResult clusterProfiler
## rename.compareClusterResult clusterProfiler
## rename.enrichResult clusterProfiler
## rename.gseaResult clusterProfiler
## select.compareClusterResult clusterProfiler
## select.enrichResult clusterProfiler
## select.gseaResult clusterProfiler
## slice.compareClusterResult clusterProfiler
## slice.enrichResult clusterProfiler
## slice.gseaResult clusterProfiler
## summarise.compareClusterResult clusterProfiler
## summarise.enrichResult clusterProfiler
## summarise.gseaResult clusterProfiler
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## Warning: The `add` argument of `group_by()` is deprecated as of dplyr 1.0.0.
## Please use the `.add` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
## Excluded 1444 from.IDs without a corresponding to.ID
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## Excluded 1444 from.IDs without a corresponding to.ID
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## Warning in fgseaMultilevel(...): For some of the pathways the P-values were
## likely overestimated. For such pathways log2err is set to NA.
## Excluded 1444 from.IDs without a corresponding to.ID
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
## no term enriched under specific pvalueCutoff...
## Excluded 1444 from.IDs without a corresponding to.ID
## Warning in preparePathwaysAndStats(pathways, stats, minSize, maxSize,
## gseaParam, : There are duplicate gene names, fgsea may produce unexpected
## results.
sapply(gseaRes_all, dim)
## PCcluster_1192 PCcluster_1533 PCcluster_2427 PCcluster_3769 PCcluster_5342
## [1,] 1 13 2 0 23
## [2,] 13 13 13 10 13
sapply(gseaRes_all, pathwaySearch, "COLO")
## PCcluster_1192 PCcluster_1533 PCcluster_2427 PCcluster_3769 PCcluster_5342
## 0 0 0 0 0
sapply(gseaRes_all, pathwaySearch, "COLO", proportion = TRUE)
## PCcluster_1192 PCcluster_1533 PCcluster_2427 PCcluster_3769 PCcluster_5342
## 0 0 0 NaN 0
for (i in seq_along(gseaRes_all)) {
res <- gseaRes_all[[i]]
gseaSub <- subsetGSEA(res, n = 20)
print(gseaBarplot(gseaRes = gseaSub))
print(gseaNetwork(gseaRes = gseaSub, similarity_metric = "overlap_similarity", similarity_cutoff = 0.3))
}



## [1] "No pathway is enriched"
## [1] "No pathway is enriched"
