Skip to content

Commit

Permalink
Adding missing documentation for Bioconductor build
Browse files Browse the repository at this point in the history
  • Loading branch information
definitelysean committed Mar 19, 2019
1 parent cd1d412 commit 4d840ee
Show file tree
Hide file tree
Showing 40 changed files with 339 additions and 38 deletions.
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,23 @@ export(simulateObservedMatrix)
export(subsetCeldaList)
export(topRank)
export(violinPlot)
exportMethods(bestLogLikelihood)
exportMethods(celdaHeatmap)
exportMethods(celdaPerplexity)
exportMethods(celdaProbabilityMap)
exportMethods(celdaTsne)
exportMethods(celdaUmap)
exportMethods(clusterProbability)
exportMethods(clusters)
exportMethods(factorizeMatrix)
exportMethods(featureModuleLookup)
exportMethods(logLikelihoodHistory)
exportMethods(matrixNames)
exportMethods(params)
exportMethods(perplexity)
exportMethods(resList)
exportMethods(runParams)
exportMethods(sampleLabel)
import(RColorBrewer)
import(data.table)
import(foreach)
Expand Down
Empty file modified R/RcppExports.R
100755 → 100644
Empty file.
87 changes: 78 additions & 9 deletions R/all_generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,62 @@ setClass("celdaModel",

#' @title Get parameter values provided for celda model creation
#' @description Retrieves the K/L, model priors (e.g. alpha, beta), random seed, and count matrix checksum parameters provided during the creation of the provided celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return List. Contains the model-specific parameters for the provided celda model object depending on its class.
#' @examples
#' params(celda.CG.mod)
#' @export
setGeneric("params",
function(celda.mod){ standardGeneric("params") })
#' @title Get parameter values provided for celda model creation
#' @description Retrieves the K/L, model priors (e.g. alpha, beta), random seed, and count matrix checksum parameters provided during the creation of the provided celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return List. Contains the model-specific parameters for the provided celda model object depending on its class.
#' @examples
#' params(celda.CG.mod)
#' @export
setMethod("params",
signature=c(celda.mod="celdaModel"),
function(celda.mod){ celda.mod@params })


#' @title Get feature, cell and sample names from a celda model
#' @description Retrieves the row, column, and sample names used to generate a celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return List. Contains row, column, and sample character vectors corresponding to the values provided when the celda model was generated.
#' @examples
#' matrixNames(celda.CG.mod)
#' @export
setGeneric("matrixNames",
function(celda.mod){ standardGeneric("matrixNames") })
#' @title Get feature, cell and sample names from a celda model
#' @description Retrieves the row, column, and sample names used to generate a celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return List. Contains row, column, and sample character vectors corresponding to the values provided when the celda model was generated.
#' @examples
#' matrixNames(celda.CG.mod)
#' @export
setMethod("matrixNames",
signature=c(celda.mod="celdaModel"),
function(celda.mod){ celda.mod@names })


#' @title Get log-likelihood history
#' @description Retrieves the complete log-likelihood from all iterations of Gibbs sampling used to generate a celda model.
#'
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return Numeric. The log-likelihood at each step of Gibbs sampling used to generate the model.
#' @examples
#' logLikelihoodHistory(celda.CG.mod)
#' @export
setGeneric("logLikelihoodHistory",
function(celda.mod){ standardGeneric("logLikelihoodHistory") })
#' @title Get log-likelihood history
#' @description Retrieves the complete log-likelihood from all iterations of Gibbs sampling used to generate a celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return Numeric. The log-likelihood at each step of Gibbs sampling used to generate the model.
#' @examples
#' logLikelihoodHistory(celda.CG.mod)
#' @export
setMethod("logLikelihoodHistory",
signature=c(celda.mod="celdaModel"),
function(celda.mod){ celda.mod@completeLogLik })
Expand All @@ -49,24 +72,39 @@ setMethod("logLikelihoodHistory",
#' @title Get the log-likelihood
#' @description Retrieves the final log-likelihood from all iterations of Gibbs sampling used to generate a celda model.
#' @return Numeric. The log-likelihood at the final step of Gibbs sampling used to generate the model.
#' @param celda.mod A celda model object of class celda_C, celda_G, or celda_CG.
#' @examples
#' bestLogLikelihood(celda.CG.mod)
#' @export
setGeneric("bestLogLikelihood",
function(celda.mod){ standardGeneric("bestLogLikelihood") })
#' @title Get the log-likelihood
#' @description Retrieves the final log-likelihood from all iterations of Gibbs sampling used to generate a celda model.
#' @return Numeric. The log-likelihood at the final step of Gibbs sampling used to generate the model.
#' @examples
#' bestLogLikelihood(celda.CG.mod)
#' @export
setMethod("bestLogLikelihood",
signature=c(celda.mod="celdaModel"),
function(celda.mod){ celda.mod@finalLogLik })


#' @title Get clustering outcomes from a celda model
#' @description Returns the z / y results corresponding to the cell / gene cluster labels determined by the provided celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return List. Contains z (for celda_C and celda_CG models) and/or y (for celda_G and celda_CG models)
#' @examples
#' clusters(celda.CG.mod)
#' @export
setGeneric("clusters",
function(celda.mod){ standardGeneric("clusters")})
#' @title Get clustering outcomes from a celda model
#' @description Returns the z / y results corresponding to the cell / gene cluster labels determined by the provided celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return List. Contains z (for celda_C and celda_CG models) and/or y (for celda_G and celda_CG models)
#' @examples
#' clusters(celda.CG.mod)
#' @export
setMethod("clusters", signature=c(celda.mod="celdaModel"),
function(celda.mod){
return(celda.mod@clusters)
Expand All @@ -80,12 +118,20 @@ setClass("celda_C",

#' @title Get sample labels from a celda model
#' @description Returns the sample labels for the count matrix provided for generation of a given celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return Character. Contains the sample labels provided at model creation time, or those automatically generated by celda.
#' @examples
#' sampleLabel(celda.CG.mod)
#' @export
setGeneric("sampleLabel",
function(celda.mod){ standardGeneric("sampleLabel") })
#' @title Get sample labels from a celda model
#' @description Returns the sample labels for the count matrix provided for generation of a given celda model.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @return Character. Contains the sample labels provided at model creation time, or those automatically generated by celda.
#' @examples
#' sampleLabel(celda.CG.mod)
#' @export
setMethod("sampleLabel",
signature=c(celda.mod="celdaModel"),
function(celda.mod){ celda.mod@sample.label })
Expand All @@ -106,38 +152,61 @@ setClass("celdaList",

#' @title Get run parameters provided to `celdaGridSearch()`
#' @description Returns details on the clustering parameters, model priors, and seeds provided to `celdaGridSearch()` when the provided celdaList was created.
#' @param celda.mod An object of class celdaList.
#' @return Data Frame. Contains details on the various K/L parameters, chain parameters, and final log-likelihoods derived for each model in the provided celdaList.
#' @examples
#' runParams(celda.CG.grid.search.res)
#' @export
setGeneric("runParams",
function(celda.mod){ standardGeneric("runParams") })
#' @title Get run parameters provided to `celdaGridSearch()`
#' @description Returns details on the clustering parameters, model priors, and seeds provided to `celdaGridSearch()` when the provided celdaList was created.
#' @param celda.mod An object of class celdaList.
#' @return Data Frame. Contains details on the various K/L parameters, chain parameters, and final log-likelihoods derived for each model in the provided celdaList.
#' @examples
#' runParams(celda.CG.grid.search.res)
#' @export
setMethod("runParams",
signature=c(celda.mod="celdaList"),
function(celda.mod){ celda.mod@run.params })


#' @title Get final celda models from a celdaList
#' @description Returns all models generated during a `celdaGridSearch()` run.
#' @param celda.mod An object of class celdaList.
#' @return List. Contains one celdaModel object for each of the parameters specified in the `runParams()` of the provided celda list.
#' @examples
#' celda.CG.grid.models = resList(celda.CG.grid.search.res)
#' @export
setGeneric("resList",
function(celda.mod){ standardGeneric("resList") })
#' @title Get final celda models from a celdaList
#' @description Returns all models generated during a `celdaGridSearch()` run.
#' @param celda.mod An object of class celdaList.
#' @return List. Contains one celdaModel object for each of the parameters specified in the `runParams()` of the provided celda list.
#' @examples
#' celda.CG.grid.models = resList(celda.CG.grid.search.res)
#' @export
setMethod("resList",
signature=c(celda.mod="celdaList"),
function(celda.mod){ celda.mod@res.list })


#' @title Get perplexity for every model in a celdaList
#' @description Returns perplexity for each model in a celdaList as calculated by `perplexity().`
#' @param celda.mod A celda model object of class "celda_C", "celda_G", or "celda_CG".
#' @return List. Contains one celdaModel object for each of the parameters specified in the `runParams()` of the provided celda list.
#' @examples
#' celda.CG.grid.model.perplexities = celdaPerplexity(celda.CG.grid.search.res)
#' @export
setGeneric("celdaPerplexity",
function(celda.mod){ standardGeneric("celdaPerplexity") })
#' @title Get perplexity for every model in a celdaList
#' @description Returns perplexity for each model in a celdaList as calculated by `perplexity().`
#' @return List. Contains one celdaModel object for each of the parameters specified in the `runParams()` of the provided celda list.
#' @examples
#' celda.CG.grid.model.perplexities = celdaPerplexity(celda.CG.grid.search.res)
#' @export
setMethod("celdaPerplexity",
signature=c(celda.mod="celdaList"),
function(celda.mod){ celda.mod@perplexity })
Expand All @@ -146,6 +215,8 @@ setMethod("celdaPerplexity",
#' @title Append two celdaList objects
#' @description Returns a single celdaList representing the combination of two provided celdaList objects.
#' @return A celdaList object. This object contains all resList entries and runParam records from both lists.
#' @param list1 A celda_list object
#' @param list2 A celda_list object to be joined with list_1
#' @examples
#' appended.list = appendCeldaList(celda.CG.grid.search.res, celda.CG.grid.search.res)
#' @export
Expand All @@ -172,7 +243,8 @@ appendCeldaList = function(list1, list2) {
#' Render a stylable heatmap of count data based on celda clustering results.
#'
#' @param counts Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.
#' @param celda.mod Celda object of class "celda_C", "celda_G", or "celda_CG".
#' @param celda.mod A celda model object of class "celda_C", "celda_G", or "celda_CG".
#' @param feature.ix Integer vector. Select features for display in heatmap. If NULL, no subsetting will be performed. Default NULL.
#' @param ... Additional parameters.
#' @examples
#' celdaHeatmap(celda.CG.sim$counts, celda.CG.mod)
Expand Down Expand Up @@ -212,13 +284,14 @@ logLikelihood = function(counts, model, ...) {
#' @param counts Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @param log Logical. If FALSE, then the normalized conditional probabilities will be returned. If TRUE, then the unnormalized log probabilities will be returned. Default FALSE.
#' @param ... Additional parameters.
#' @examples
#' cluster.prob = clusterProbability(celda.CG.sim$counts, celda.CG.mod)
#' @return A numeric vector of the cluster assignment probabilties
#' @export
setGeneric("clusterProbability",
signature="celda.mod",
function(counts, celda.mod, log=FALSE, modules=NULL, ...) {
function(counts, celda.mod, log=FALSE, ...) {
standardGeneric("clusterProbability")
})

Expand All @@ -229,7 +302,7 @@ setGeneric("clusterProbability",
#' cluster assignments fit the data being clustered.
#'
#' @param counts Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.
#' @param celda.mod Celda object of class "celda_C", "celda_G" or "celda_CG".
#' @param celda.mod Celda model. Options available in `celda::available.models`.
#' @param new.counts A new counts matrix used to calculate perplexity. If NULL, perplexity will be calculated for the 'counts' matrix. Default NULL.
#' @return Numeric. The perplexity for the provided count data and model.
#' @examples
Expand Down Expand Up @@ -308,7 +381,6 @@ setGeneric("celdaProbabilityMap",
#' @param max.iter Integer. Maximum number of iterations in tSNE generation. Default 2500.
#' @param seed Integer. Passed to `set.seed()`. Default 12345. If NULL, no calls to `set.seed()` are made.
#' @param ... Additional parameters.
#' @param ... Additional parameters.
#' @return Numeric Matrix of dimension `ncol(counts)` x 2, colums representing the "X" and "Y" coordinates in the data's t-SNE represetation.
#' @examples
#' tsne.res = celdaTsne(celda.CG.sim$counts, celda.CG.mod)
Expand All @@ -331,10 +403,7 @@ setGeneric("celdaTsne",
#' @param max.cells Integer. Maximum number of cells to plot. Cells will be randomly subsampled if ncol(counts) > max.cells. Larger numbers of cells requires more memory. Default 25000.
#' @param min.cluster.size Integer. Do not subsample cell clusters below this threshold. Default 100.
#' @param modules Integer vector. Determines which features modules to use for tSNE. If NULL, all modules will be used. Default NULL.
#' @param perplexity Numeric. Perplexity parameter for tSNE. Default 20.
#' @param max.iter Integer. Maximum number of iterations in tSNE generation. Default 2500.
#' @param seed Integer. Passed to `set.seed()`. Default 12345. If NULL, no calls to `set.seed()` are made.
#' @param ... Additional parameters.
#' @param umap.config An object of class "umap.config" specifying parameters to the UMAP algorithm.
#' @param ... Additional parameters.
#' @return Numeric Matrix of dimension `ncol(counts)` x 2, colums representing the "X" and "Y" coordinates in the data's t-SNE represetation.
#' @examples
Expand Down
8 changes: 4 additions & 4 deletions R/celda_C.R
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ cC.calcLL = function(m.CP.by.S, n.G.by.CP, s, z, K, nS, nG, alpha, beta) {
#' @description Calculates the log likelihood for user-provided cell population clusters using the `celda_C()` model.
#'
#' @param counts Integer matrix. Rows represent features and columns represent cells.
#' @param model An object of class celda_C.
#' @param sample.label Vector or factor. Denotes the sample label for each cell (column) in the count matrix.
#' @param z Numeric vector. Denotes cell population labels.
#' @param K Integer. Number of cell populations.
Expand Down Expand Up @@ -605,6 +606,7 @@ setMethod("celdaHeatmap",
#' @param max.cells Integer. Maximum number of cells to plot. Cells will be randomly subsampled if ncol(counts) > max.cells. Larger numbers of cells requires more memory. Default 25000.
#' @param min.cluster.size Integer. Do not subsample cell clusters below this threshold. Default 100.
#' @param initial.dims Integer. PCA will be used to reduce the dimentionality of the dataset. The top 'initial.dims' principal components will be used for tSNE. Default 20.
#' @param modules Integer vector. Determines which features modules to use for tSNE. If NULL, all modules will be used. Default NULL.
#' @param perplexity Numeric. Perplexity parameter for tSNE. Default 20.
#' @param max.iter Integer. Maximum number of iterations in tSNE generation. Default 2500.
#' @param seed Integer. Passed to `set.seed()`. Default 12345. If NULL, no calls to `set.seed()` are made.
Expand Down Expand Up @@ -641,10 +643,8 @@ setMethod("celdaTsne",
#' @param celda.mod Celda object of class `celda_C`.
#' @param max.cells Integer. Maximum number of cells to plot. Cells will be randomly subsampled if ncol(counts) > max.cells. Larger numbers of cells requires more memory. Default 25000.
#' @param min.cluster.size Integer. Do not subsample cell clusters below this threshold. Default 100.
#' @param initial.dims Integer. PCA will be used to reduce the dimentionality of the dataset. The top 'initial.dims' principal components will be used for tSNE. Default 20.
#' @param perplexity Numeric. Perplexity parameter for tSNE. Default 20.
#' @param max.iter Integer. Maximum number of iterations in tSNE generation. Default 2500.
#' @param seed Integer. Passed to `set.seed()`. Default 12345. If NULL, no calls to `set.seed()` are made.
#' @param modules Integer vector. Determines which features modules to use for UMAP. If NULL, all modules will be used. Default NULL.
#' @param umap.config An object of class "umap.config" specifying parameters to the UMAP algorithm.
#' @param ... Additional parameters.
#' @seealso `celda_C()` for clustering cells and `celdaHeatmap()` for displaying expression
#' @examples
Expand Down
1 change: 1 addition & 0 deletions R/celda_CG.R
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ setMethod("celdaHeatmap",
#' @param celda.mod Celda object of class `celda_CG`.
#' @param max.cells Integer. Maximum number of cells to plot. Cells will be randomly subsampled if ncol(counts) > max.cells. Larger numbers of cells requires more memory. Default 25000.
#' @param min.cluster.size Integer. Do not subsample cell clusters below this threshold. Default 100.
#' @param initial.dims Integer. PCA will be used to reduce the dimentionality of the dataset. The top 'initial.dims' principal components will be used for tSNE. Default 20.
#' @param modules Integer vector. Determines which features modules to use for tSNE. If NULL, all modules will be used. Default NULL.
#' @param perplexity Numeric. Perplexity parameter for tSNE. Default 20.
#' @param max.iter Integer. Maximum number of iterations in tSNE generation. Default 2500.
Expand Down
2 changes: 2 additions & 0 deletions R/celda_G.R
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ setMethod("celdaHeatmap",
#' @param counts Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.
#' @param celda.mod Celda object of class `celda_G`.
#' @param max.cells Integer. Maximum number of cells to plot. Cells will be randomly subsampled if ncol(conts) > max.cells. Larger numbers of cells requires more memory. Default 10000.
#' @param min.cluster.size Integer. Do not subsample cell clusters below this threshold. Default 100.
#' @param initial.dims Integer. PCA will be used to reduce the dimentionality of the dataset. The top 'initial.dims' principal components will be used for tSNE. Default 20.
#' @param modules Integer vector. Determines which feature modules to use for tSNE. If NULL, all modules will be used. Default NULL.
#' @param perplexity Numeric. Perplexity parameter for tSNE. Default 20.
#' @param max.iter Integer. Maximum number of iterations in tSNE generation. Default 2500.
Expand Down
5 changes: 5 additions & 0 deletions man/appendCeldaList.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4d840ee

Please sign in to comment.