R/ti_raceid_stemid.R

Defines functions ti_raceid_stemid

Documented in ti_raceid_stemid

######################################### DO NOT EDIT! #########################################
#### This file is automatically generated from data-raw/2-generate_r_code_from_containers.R ####
################################################################################################

#' @title RaceID / StemID
#' 
#' @description
#' Will generate a trajectory using [RaceID /
#' StemID](https://doi.org/10.1016/j.stem.2016.05.010).
#' 
#' This method was wrapped inside a
#' [container](https://github.com/dynverse/ti_raceid_stemid).
#' The original code of this method is available
#' [here](https://github.com/dgrun/RaceID3_StemID2_package).
#' 
#' @references Grün, D., Muraro, M.J., Boisset, J.-C., Wiebrands, K., Lyubimova,
#' A., Dharmadhikari, G., van den Born, M., van Es, J., Jansen, E., Clevers, H.,
#' de Koning, E.J.P., van Oudenaarden, A., 2016. De Novo Prediction of Stem Cell
#' Identity using Single-Cell Transcriptome Data. Cell Stem Cell 19, 266–277.
#' 
#' @param knn Number of nearest neighbors used to infer corresponding cell types
#' in different batches. Domain: U(5, 50). Default: 10. Format: integer.
#' @param ccor Correlation coefficient used as a treshhold for determining genes
#' correlated to eachother. Domain: U(0, 1). Default: 0.4. Format: numeric.
#' @param metric Distances are computed from the filtered expression matrix after
#' optional feature selection, dimensional reduction, and/or transformation (batch
#' correction). Domain: {pearson, spearman, logpearson, euclidean}. Default:
#' pearson. Format: character.
#' @param sat If `TRUE`, then the number of clusters is determined based on
#' finding the saturation point of the mean within-cluster dispersion as a
#' function of the cluster number. If `FALSE`, then cluster number needs to be
#' given as `cln`. Default: TRUE. Format: logical.
#' @param samp Number of bootstrapping runs for clusterboot. Domain: e^U(3.91,
#' 9.21). Default: 1000. Format: integer.
#' @param cln Number of clusters to be used. If `sat` is `TRUE`, this number is
#' inferred by the saturation criterion. Domain: U(10, 100). Default: 30. Format:
#' integer.
#' @param clustnr Maximum number of clusters for the derivation of the cluster
#' number by the saturation of mean within-cluster-dispersion. Domain: U(10, 100).
#' Default: 30. Format: integer.
#' @param bootnr Number of booststrapping runs for clusterboot. Domain: U(20,
#' 100). Default: 50. Format: integer.
#' @param FUNcluster Clustering method used by RaceID3. Domain: {kmedoids, kmeans,
#' hclust}. Default: kmedoids. Format: character.
#' @param probthr Outlier probability threshold for a minimum of outlg genes to be
#' an outlier cell. This probability is computed from a negative binomial
#' background model of expression in a cluster. Domain: e^U(-11.51, 0.00).
#' Default: 0.001. Format: numeric.
#' @param outminc Minimal transcript count of a gene in a clusters to be tested
#' for being an outlier gene. Domain: U(0, 100). Default: 5. Format: integer.
#' @param outlg Minimum number of outlier genes required for being an outlier
#' cell. Domain: U(0, 100). Default: 2. Format: integer.
#' @param outdistquant Real number between zero and one. Outlier cells are merged
#' to outlier clusters if their distance smaller than the outdistquant-quantile of
#' the distance distribution of pairs of cells in the orginal clusters after
#' outlier removal. Domain: U(0, 1). Default: 0.95. Format: numeric.
#' @param initial_cmd If TRUE, then the t-SNE map computation is initialized with
#' a configuration obtained by classical multidimensional scaling. Default: TRUE.
#' Format: logical.
#' @param perplexity Perplexity of the t-SNE map. Domain: U(5, 100). Default: 30.
#' Format: integer.
#' @param cthr Clusters to be included into the StemID2 analysis must contain more
#' than cthr cells. D. Domain: U(1, 25). Default: 5. Format: integer.
#' @param nmode If `TRUE`, then a cell of given cluster is assigned to the link to
#' the cluster with the smallest average distance of the knn nearest neighbours
#' within this cluster. Default: TRUE. Format: logical.
#' @param projcells_knn See `nmode`. Domain: U(3, 20). Default: 3. Format:
#' integer.
#' @param fr Use Fruchterman-Rheingold layout instead of t-SNE for
#' dimensional-reduction representation of the lineage tree. Default: FALSE.
#' Format: logical.
#' @param pdishuf Number of randomizations of cell positions for which to compute
#' projections of cells on inter-cluster links. Domain: e^U(2.30, 9.21). Default:
#' 500. Format: integer.
#' @param fast If `TRUE` and `nmode` is `FALSE` cells will still be assigned to
#' links based on maximum projections but a fast approximate background model will
#' be used to infer significance. The function will do nothing in this case.
#' Default: FALSE. Format: logical.
#' @param pthr P-value cutoff for link significance. This threshold is applied for
#' the calculation of link scores reflecting how uniformly a link is occupied by
#' cells. Domain: e^U(-11.51, 0.00). Default: 0.01. Format: numeric.
#' @param scthr Score threshold for links to be shown in the graph. Domain: U(0,
#' 1). Default: 0.2. Format: numeric.
#' 
#' @keywords method
#' 
#' @return A TI method wrapper to be used together with
#' \code{\link[dynwrap:infer_trajectories]{infer_trajectory}}
#' @export
ti_raceid_stemid <- function(
    knn = 10L,
    ccor = 0.4,
    metric = "pearson",
    sat = TRUE,
    samp = 1000L,
    cln = 30L,
    clustnr = 30L,
    bootnr = 50L,
    FUNcluster = "kmedoids",
    probthr = 0.001,
    outminc = 5L,
    outlg = 2L,
    outdistquant = 0.95,
    initial_cmd = TRUE,
    perplexity = 30L,
    cthr = 5L,
    nmode = TRUE,
    projcells_knn = 3L,
    fr = FALSE,
    pdishuf = 500L,
    fast = FALSE,
    pthr = 0.01,
    scthr = 0.2
) {
  method_choose_backend(
    package_repository = NULL,
    package_name = NULL,
    function_name = NULL,
    package_version = NULL,
    container_id = "dynverse/ti_raceid_stemid:v0.9.9.01"
  )(
    knn = knn,
    ccor = ccor,
    metric = metric,
    sat = sat,
    samp = samp,
    cln = cln,
    clustnr = clustnr,
    bootnr = bootnr,
    FUNcluster = FUNcluster,
    probthr = probthr,
    outminc = outminc,
    outlg = outlg,
    outdistquant = outdistquant,
    initial_cmd = initial_cmd,
    perplexity = perplexity,
    cthr = cthr,
    nmode = nmode,
    projcells_knn = projcells_knn,
    fr = fr,
    pdishuf = pdishuf,
    fast = fast,
    pthr = pthr,
    scthr = scthr
  )
}
dynverse/dynmethods documentation built on Jan. 18, 2024, 4:44 a.m.