Skip to content

Commit

Permalink
fit for check!
Browse files Browse the repository at this point in the history
  • Loading branch information
linazhu3 committed Nov 23, 2017
1 parent 160d038 commit b03cfae
Show file tree
Hide file tree
Showing 48 changed files with 176 additions and 977 deletions.
11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ Package: HTSanalyzeR2
Type: Package
Title: Gene set over-representation, enrichment and network analyses for high-
throughput data and corresponding time-series data
Version: 0.99.0
Version: 0.99.1
Author: Lina ZHU, Xiupei MEI, Feng GAO, Xin WANG
Maintainer: Lina ZHU<zhulina0609@gmail.com>, Xiupei MEI <meixiupei@gmail.com>, Feng GAO <gaofeng21cn@gmail.com>
Maintainer: Lina ZHU<zhulina0609@gmail.com>
Description: This package provides classes and methods for gene set over-
representation, enrichment and network analyses on various high-throughput
data as well as corresponding time-series data.
data as well as corresponding time-series data generated by CRISPR, RNAi,
RNA-seq and micro-array.
License: Artistic-2.0
LazyData: TRUE
RoxygenNote: 6.0.1
Imports:
GO.db,
cellHTS2,
doParallel,
Rcpp,
foreach,
stringr,
Expand Down Expand Up @@ -67,9 +67,8 @@ Suggests:
rmarkdown,
testthat,
knitr,
Homo.sapiens,
org.Hs.eg.db,
org.Dm.eg.db,
doParallel,
Biobase
VignetteBuilder: knitr
Depends: R(>= 3.4)
Expand Down
2 changes: 1 addition & 1 deletion HTSanalyzeR2.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageCheckArgs: --no-vignettes --no-examples
PackageCheckArgs: --no-vignettes
PackageRoxygenize: rd,collate,namespace
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export(appendGSTermsTS)
export(cellHTS2OutputStatTests)
export(duplicateRemover)
export(interactomeNwaTS)
export(networkAnalysis)
export(preprocessGscaTS)
export(preprocessNwaTS)
export(reportAll)
Expand All @@ -34,7 +33,6 @@ exportMethods(viewSubNet)
import(DT)
import(GO.db)
import(colourpicker)
import(doParallel)
import(foreach)
import(graphics)
importFrom(AnnotationDbi,GOID)
Expand Down
4 changes: 0 additions & 4 deletions R/Batch_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#' @slot listOfGSCA A list of initialized GSCA object for futher GSCA.
#' @export
#' @examples
#' \dontrun{
#' data(d7, d13, d25)
#'
#' ## generate expInfor to describe the information of time series data
Expand Down Expand Up @@ -54,7 +53,6 @@
#' gscaTS <- new("GSCABatch", expInfor = expInfor, phenotypeTS = phenotypeTS,
#' listOfGeneSetCollections = ListGSC)
#' gscaTS
#' }


# GSCABatch ----------------------------------------------------------------
Expand Down Expand Up @@ -156,7 +154,6 @@ setMethod("show", signature = "GSCABatch", function(object) {
#' @slot interactome An object of class igraph.
#' @slot listOfNWA A list of 'NWA' object.
#' @examples
#' \dontrun{
#' data(d7, d13, d25)
#'
#' ## generate expInfor to describe the information of time series data
Expand All @@ -181,7 +178,6 @@ setMethod("show", signature = "GSCABatch", function(object) {
#'
#' ## Example2: create an object of class 'NWABatch' without phenotypes
#' nwaTS <- new("NWABatch", expInfor = expInfor, pvalueTS = pvalueTS)
#' }
#' @export
#' @aliases NWABatch
setClass(
Expand Down
2 changes: 2 additions & 0 deletions R/HTSanalyzeR4MAGeCK.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#' the results in. All the results would be stored as RData named 'results.RData' under
#' a new automatic generated directory. It can be loaded into R by 'readRDS(results.RData)'.
#' @examples
#' \dontrun{
#' data(d7)
#'
#' library(GO.db)
Expand All @@ -84,6 +85,7 @@
#' keggGSCs=c("PW_KEGG"),
#' goGSCs = c("GO_MF"),
#' nwAnalysisFdr = 0.0001)
#' }
#' @export
#' @importFrom methods new
HTSanalyzeR4MAGeCK <- function(MAGeCKdata,
Expand Down
30 changes: 24 additions & 6 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
#' refer to \href{https://sourceforge.net/p/mageck/wiki/Home/}{MAGeCK}.
#'
#' @aliases d13 d25
#' @references
#' Tzelepis K, Koike-Yusa H, De Braekeleer E, et al. A CRISPR Dropout Screen Identifies
#' Genetic Vulnerabilities and Therapeutic Targets in Acute Myeloid Leukemia. Cell Reports.
#' 2016;17(4):1193-1205. doi:10.1016/j.celrep.2016.09.079.
#' @examples
#' data(d7)
#' data(d13)
#' data(d25)
#'
"d7"

Expand All @@ -14,6 +22,8 @@
#' The differential expressed analysis result between CMS4 colon cancer subtype and
#' non-CMS4 of a gene expression dataset with GEO number-"GSE33113" using R package \emph{limma}.
#'
#' @examples
#' data(GSE33113_limma)
#'
"GSE33113_limma"

Expand All @@ -22,22 +32,25 @@
#'
#' An object of class 'GSCA' generated by \emph{HTSanalyzeR2}.
#'
#'
#' @examples
#' data(d7_gsca)
"d7_gsca"


#' A list of 'GSCA' object
#'
#' A list of 'GSCA' object generated by time-series analysis using \emph{HTSanalyzeR2}.
#'
#'
#' @examples
#' data(gscaTS)
"gscaTS"


#' An object of class 'NWA'
#'
#' An object of class 'NWA' generated by \emph{HTSanalyzeR2}.
#'
#' @examples
#' data(d7_nwa)
#'
"d7_nwa"

Expand All @@ -46,15 +59,17 @@
#'
#' A list of 'NWA' object generated by time-series analysis using \emph{HTSanalyzeR2}.
#'
#'
#' @examples
#' data(nwaTS)
"nwaTS"


#' An interactome matrix for \emph{Homo Sapiens}
#'
#' An interactome matrix for \emph{Homo Sapiens}.
#'
#'
#' @examples
#' data(Biogrid_HS_Mat)
"Biogrid_HS_Mat"


Expand All @@ -63,11 +78,14 @@
#' An object of class 'igraph' built from the interactome data set for
#' \emph{Homo Sapiens} downloaded from the \emph{BioGRID} database.
#'
#' @examples
#' data(Biogrid_HS_Interactome)
"Biogrid_HS_Interactome"


#' An object of class 'cellHTS2'
#'
#' An object of class 'cellHTS2' which has been normalized, configured and annotated.
#'
#' @examples
#' data(xn)
"xn"
12 changes: 11 additions & 1 deletion R/gscaTS.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ preprocessGscaTS <- function(object, species="Hs", initialIDs="SYMBOL",
#' orderAbsValue=FALSE)
#'
#' ## support parallel calculation using doParallel package
#' if (requireNamespace("doParallel", quietly=TRUE)) {
#' doParallel::registerDoParallel(cores=2)
#' } else {
#' ## code when "doParallel" is not available
#' }
#'
#' ## do hypergeometric tests and GSEA
#' gscaTS2 <- analyzeGscaTS(gscaTS1, para=list(pValueCutoff=0.05, pAdjustMethod="BH",
Expand Down Expand Up @@ -203,7 +207,11 @@ analyzeGscaTS <- function(gscaList, para=list(pValueCutoff=0.05, pAdjustMethod="
#' orderAbsValue=FALSE)
#'
#' ## support parallel calculation using doParallel package
#' doParallel::registerDoParallel(cores=4)
#' if (requireNamespace("doParallel", quietly=TRUE)) {
#' doParallel::registerDoParallel(cores=2)
#' } else {
#' ## code when "doParallel" is not available
#' }
#'
#' ## do hypergeometric tests and GSEA
#' gscaTS2 <- analyzeGscaTS(gscaTS1, para=list(pValueCutoff=0.05, pAdjustMethod="BH",
Expand All @@ -212,8 +220,10 @@ analyzeGscaTS <- function(gscaList, para=list(pValueCutoff=0.05, pAdjustMethod="
#' head(gscaTS2[[1]]@@result$GSEA.results$GO_BP, 3)
#'
#' ## append gene set terms to results
#' \dontrun{
#' gscaTS3 <- appendGSTermsTS(gscaTS2, goGSCs=c("GO_BP"))
#' head(gscaTS3[[1]]@@result$GSEA.results$GO_BP, 3)
#' }
appendGSTermsTS <- function(gscaList, keggGSCs=NULL, goGSCs=NULL, msigdbGSCs=NULL){
paraCheck("gscaTS", "gscaList", gscaList)
tmpName <- names(gscaList)
Expand Down
5 changes: 4 additions & 1 deletion R/gsca_analyze.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ if (!isGeneric("analyze")) {
#' duplicateRemoverMethod="max", orderAbsValue=FALSE)
#'
#' ## support parallel calculation using doParallel package
#' if (requireNamespace("doParallel", quietly=TRUE)) {
#' doParallel::registerDoParallel(cores=2)
#' } else {
#' ## code when "doParallel" is not available
#' }
#'
#' ## do hypergeometric tests and GSEA
#' gsca2 <- analyze(gsca1, para=list(pValueCutoff=0.01, pAdjustMethod ="BH",
Expand Down Expand Up @@ -457,7 +461,6 @@ calcHGTScore <- function(geneSet, universe, hits) {

#' @import foreach
#' @importFrom stats p.adjust
#' @import doParallel
calcGSEA <-
function(listOfGeneSetCollections,
geneList,
Expand Down
2 changes: 0 additions & 2 deletions R/gsca_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#'
#' @export
#' @examples
#' \dontrun{
#' library(org.Hs.eg.db)
#' library(GO.db)
#' ## load data for enrichment analyses
Expand All @@ -57,7 +56,6 @@
#' gsca <- new("GSCA", listOfGeneSetCollections = ListGSC, geneList = phenotype)
#' gsca
#' gsca@@summary
#' }

setClass(
Class = "GSCA",
Expand Down
11 changes: 8 additions & 3 deletions R/gsca_enrichmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,16 @@ setMethod("extractEnrichMap", signature = "GSCA",
#' data(d7_gsca)
#'
#' ## Example1: view an enrichment map for top 7 significant 'GO_MF' gene sets of GSEA results
#' \dontrun{
#' viewEnrichMap(d7_gsca, resultName = "GSEA.results", gscs=c("GO_MF"),
#' allSig = FALSE, ntop = 7, gsNameType = "term")
#'
#' }
#' ## Example2: view an enrichment map for top 7 significant 'GO_MF'
#' ## and 'PW_KEGG' gene sets of GSEA results
#' \dontrun{
#' viewEnrichMap(d7_gsca, resultName = "GSEA.results", gscs=c("GO_MF", "PW_KEGG"),
#' allSig = FALSE, ntop = 7, gsNameType = "term")
#'
#' }
#' ## Example3: view an enrichment map with specificGenesets in 'GO_MF' gene sets of GSEA results
#' ## As told previously, specificGeneset needs to be a subset of all analyzed gene sets
#' ## which can be roughly gotten by:
Expand All @@ -397,10 +399,11 @@ setMethod("extractEnrichMap", signature = "GSCA",
#' GO_MF_geneset <- tmp$GO_MF[c(4,2,6,9,12)]
#' ## the name of specificGenesets also needs to match with the names of tmp
#' specificGeneset <- list("GO_MF"=GO_MF_geneset)
#' \dontrun{
#' viewEnrichMap(d7_gsca, resultName = "GSEA.results", gscs=c("GO_MF"),
#' allSig = FALSE, gsNameType = "term",
#' ntop = NULL, specificGeneset = specificGeneset)
#'
#' }
#'
#' ## Example4: view an enrichment map with specificGenesets in 'GO_MF'
#' ## and 'PW_KEGG' gene sets of GSEA results
Expand All @@ -409,9 +412,11 @@ setMethod("extractEnrichMap", signature = "GSCA",
#' GO_MF_geneset <- tmp$GO_MF[c(6,3,5,9,12)]
#' PW_KEGG_geneset <- tmp$PW_KEGG[c(7,2,5,1,9)]
#' specificGeneset <- list("GO_MF"=GO_MF_geneset, "PW_KEGG"=PW_KEGG_geneset)
#' \dontrun{
#' viewEnrichMap(d7_gsca, resultName = "GSEA.results", gscs=c("GO_MF", "PW_KEGG"),
#' allSig = FALSE, gsNameType = "term",
#' ntop = NULL, specificGeneset = specificGeneset)
#' }
#' @export
#' @references
#' Merico D, Isserlin R, Stueker O, Emili A, Bader GD (2010) Enrichment Map:
Expand Down
10 changes: 5 additions & 5 deletions R/gsca_preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,17 @@ duplicateRemover <- function(geneList, method = "max") {
#' @return The same data vector/matrix but with names/row names converted.
#'
#' @examples
#' library(org.Dm.eg.db)
#' library(org.Hs.eg.db)
#' ## Example1: convert a named vector
#' x <- runif(10)
#' names(x) <- names(as.list(org.Dm.egSYMBOL2EG))[1:10]
#' xEntrez <- annotationConvertor(geneList=x, species="Dm", initialIDs="SYMBOL",
#' names(x) <- names(as.list(org.Hs.egSYMBOL2EG))[1:10]
#' xEntrez <- annotationConvertor(geneList=x, species="Hs", initialIDs="SYMBOL",
#' finalIDs="ENTREZID")
#'
#' ## Example2: convert a data matrix with row names as gene ids
#' x <- cbind(runif(10),runif(10))
#' rownames(x) <- names(as.list(org.Dm.egSYMBOL2EG))[1:10]
#' xEntrez <- annotationConvertor(geneList=x, species="Dm", initialIDs="SYMBOL",
#' rownames(x) <- names(as.list(org.Hs.egSYMBOL2EG))[1:10]
#' xEntrez <- annotationConvertor(geneList=x, species="Hs", initialIDs="SYMBOL",
#' finalIDs="ENTREZID")
#' @export
#' @importFrom AnnotationDbi mapIds columns
Expand Down
6 changes: 4 additions & 2 deletions R/gsca_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ if (!isGeneric("report")) {
#' @return in the end, this function would generate a shiny report.
#' @examples
#' # =======================================================
#' \dontrun{
#' # GSCA class
#' ## load a GSCA object(see the examples of analyze GSCA for details)
#' data(d7_gsca)
#'
#' ## Example1: report d7_gsca
#' \dontrun{
#' report(d7_gsca)
#' }
#'
#' ## Example2: report d7_gsca containing enrichment map with specificGeneset
#' tmp <- getTopGeneSets(d7_gsca, resultName = "GSEA.results", gscs=c("GO_MF"),
Expand All @@ -45,6 +46,7 @@ if (!isGeneric("report")) {
#' GO_MF_geneset <- tmp$GO_MF[c(4,2,6,9,12)]
#' ## the name of specificGenesets also needs to match with the names of tmp
#' specificGeneset <- list("GO_MF"=GO_MF_geneset)
#' \dontrun{
#' report(d7_gsca, specificGeneset=specificGeneset)
#' }
#' @rdname report
Expand Down Expand Up @@ -74,7 +76,7 @@ setMethod("report", signature = "GSCA",
#' @export
#' @return in the end, this function would generate a shiny report.
#' @examples
#' \donttest{
#' \dontrun{
#' ## load data
#' data(d7_gsca, d7_nwa, gscaTS, nwaTS)
#'
Expand Down
4 changes: 4 additions & 0 deletions R/gsca_view.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ if(!isGeneric("plotGSEA"))
#' topGS_GO_MF <- getTopGeneSets(d7_gsca, "GSEA.results", gscs = "GO_MF", allSig=TRUE)
#'
#' ## view GSEA results for one gene set
#' \dontrun{
#' viewGSEA(d7_gsca, "GO_MF", topGS_GO_MF[["GO_MF"]][1])
#' }
#' @include gsca_class.R
#' @export
setMethod(
Expand Down Expand Up @@ -91,7 +93,9 @@ setMethod(
#' summarize(d7_gsca)
#'
#' ## plot significant gene sets in GO_MF and PW_KEGG
#' \dontrun{
#' plotGSEA(d7_gsca, gscs=c("GO_MF","PW_KEGG"), ntop=3, filepath=".")
#' }
#' @export
##plot GSEA for GSCA
setMethod(
Expand Down
Loading

0 comments on commit b03cfae

Please sign in to comment.