Skip to content

Commit c120447

Browse files
committed
documentation
1 parent c1fd962 commit c120447

2 files changed

Lines changed: 30 additions & 11 deletions

File tree

R/convenience.R

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ setGemmaUser <- function(username = NULL, password = NULL) {
1616

1717
#' Gemma platform annotations
1818
#'
19-
#' Gets Gemma's platform annotation files that can be accessed from https://gemma.msl.ubc.ca/annots/
19+
#' Gets Gemma's platform annotations including mappings of microarray probes to genes.
2020
#'
2121
#' @param platform A platform identifier @seealso getPlatforms
2222
#' @param annotType Which GO terms should the output include
@@ -131,9 +131,9 @@ memgetPlatformAnnotation <- function(platform,
131131
}
132132

133133

134-
#' Dataset expression and design
134+
#' Access gene expression data and metadata
135135
#'
136-
#' Combines various endpoint calls to return an annotated Bioconductor-compatible
136+
#' Return an annotated Bioconductor-compatible
137137
#' data structure of the queried dataset, including expression data and
138138
#' the experimental design.
139139
#'
@@ -251,14 +251,30 @@ getDatasetTidy <- function(dataset, filter = FALSE, memoised = getOption("gemma
251251
dplyr::rename(sample = .data$Sample, probe = .data$Probe)
252252
}
253253

254-
#' Dataset differential expression
254+
#' Retrieve differential expression results
255255
#'
256-
#' Retrieves the differential expression resultSet(s) associated with the dataset.
257-
#' If there is more than one resultSet, use [getDatasetResultSets()] or [getDatasetDEA()] to see
258-
#' the options and get the ID you want. Alternatively, you can query the resultSet
256+
#' Retrieves the differential expression result set(s) associated with the dataset.
257+
#' If there is more than one result set, use [getDatasetResultSets()] or [getDatasetDEA()] to see
258+
#' the options and get the ID you want. Alternatively, you can query the resultset
259259
#' directly if you know its ID beforehand.
260+
#'
261+
#' In Gemma each result set corresponds to
262+
#' the estimated effects associated with a single factor in the design, and each can have multiple contrasts (for each level compared to baseline).
263+
#' Thus a dataset with a 2x3 factorial design will have two result sets, one of which will have one contrast, and one having two contrasts.
260264
#'
261-
#' Methodology for differential expression is explained in \href{https://doi.org/10.1093/database/baab006}{Curation of over 10000 transcriptomic studies to enable data reuse}. Specifically, "differential expression analysis is performed on the dataset based on the annotated experimental design. In cases where certain terms are used (e.g. ‘reference substance role’ (OBI_0000025), ‘reference subject role’ (OBI_0000220), ‘initial time point’ (EFO_0004425), ‘wild type genotype’ (EFO_0005168), ‘control’ (EFO_0001461), etc.), Gemma automatically assigns these conditions as the baseline control group; in absence of a clear control condition, a baseline is arbitrarily selected. To perform the analysis, a generalized linear model is fit to the data for each platform element (probe/gene). For RNA-seq data, we use weighted regression, using an in-house implementation of the voom algorithm to compute weights from the mean–variance relationship of the data. Contrasts of each condition are then compared to the selected baseline. In datasets where the ‘batch’ factor is confounded with another factor, separate differential expression analyses are performed on subsets of the data; the subsets being determined by the levels of the confounding factor."
265+
#' The methodology for differential expression is explained in \href{https://doi.org/10.1093/database/baab006}{Curation of over 10000 transcriptomic studies to enable data reuse}.
266+
#' Briefly, differential expression analysis is performed on the dataset based on the annotated
267+
#' experimental design with up two three potentially nested factors.
268+
#' Gemma attempts to automatically assign baseline conditions for each factor.
269+
#' In the absence of a clear control condition, a baseline is arbitrarily selected.
270+
#' A generalized linear model with empirical Bayes shrinkage of t-statistics is fit to the data
271+
#' for each platform element (probe/gene) using an implementation of the limma algorithm. For RNA-seq data,
272+
#' we use weighted regression, applying the
273+
#' voom algorithm to compute weights from the mean–variance relationship of the data.
274+
#' Contrasts of each condition are then computed compared to the selected baseline.
275+
#' In some situations, Gemma will split the data into subsets for analysis.
276+
#' A typical such situation is when a ‘batch’ factor is present and confounded with another factor,
277+
#' the subsets being determined by the levels of the confounding factor.
262278
#'
263279
#' @param dataset A dataset identifier.
264280
#' @param resultSet A resultSet identifier.

R/gemma.R.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#' gemma.R package: Access curated gene expression data
1+
#' gemma.R package: Access curated gene expression data and differential expression analyses
22
#'
3-
#' This package containts low- and high-level wrappers for Gemma's RESTful API
3+
#' This package contains wrappers and convenience function for Gemma's RESTful API
44
#' that enable access to curated expression and differential expression data
5-
#' from over 10,000 published studies. Gemma is a web site, database and a set
5+
#' from over 15,000 published studies (as of mid-2022). Gemma (https://gemma.msl.ubc.ca) is a web site, database and a set
66
#' of tools for the meta-analysis, re-use and sharing of genomics data,
77
#' currently primarily targeted at the analysis of gene expression profiles.
88
#'
@@ -13,6 +13,9 @@
1313
#' \item Gene endpoints: Access information about specific genes.
1414
#' }
1515
#'
16+
#' Most users will want to start with the high-level functions getDataset, getDatasetDE and getPlatformAnnotations.
17+
#' Additional lower-level methods are available that directly map to the Gemma RESTful API methods.
18+
#'
1619
#' For more information and detailed usage instructions check the
1720
#' \href{https://pavlidislab.github.io/gemma.R/index.html}{README}, the
1821
#' \href{https://pavlidislab.github.io/gemma.R/reference/index.html}{function reference}

0 commit comments

Comments
 (0)