This function will compute a TSNE embedding and add it to an ArchRProject.

addTSNE(
  ArchRProj = NULL,
  reducedDims = "IterativeLSI",
  method = "RTSNE",
  name = "TSNE",
  perplexity = 50,
  maxIterations = 1000,
  learningRate = 200,
  dimsToUse = NULL,
  scaleDims = NULL,
  corCutOff = 0.75,
  saveModel = FALSE,
  verbose = TRUE,
  seed = 1,
  force = FALSE,
  threads = max(floor(getArchRThreads()/2), 1),
  ...
)

Arguments

ArchRProj

An ArchRProject object.

reducedDims

The name of the reducedDims object (i.e. "IterativeLSI") to use from the designated ArchRProject.

method

The method for computing a TSNE embedding to add to the ArchRProject object. Possible options are "RTSNE", which uses Rtsne::Rtsne(), and "FFRTSNE", which uses Seurat::RunTSNE().

name

The name for the TSNE embedding to store in the given ArchRProject object.

perplexity

An integer describing the number of nearest neighbors to compute an Rtsne. This argument is passed to perplexity in Rtsne::Rtsne().

maxIterations

An integer describing the maximum number of iterations when computing a TSNE. This argument is passed to max_iter in Rtsne::Rtsne().

learningRate

An integer controlling how much the weights are adjusted at each iteration. This argument is passed to eta in Rtsne::Rtsne().

dimsToUse

A vector containing the dimensions from the reducedDims object to use in computing the embedding.

scaleDims

A boolean value that indicates whether to z-score the reduced dimensions for each cell. This is useful for minimizing the contribution of strong biases (dominating early PCs) and lowly abundant populations. However, this may lead to stronger sample-specific biases since it is over-weighting latent PCs. If set to NULL this will scale the dimensions based on the value of scaleDims when the reducedDims were originally created during dimensionality reduction. This idea was introduced by Timothy Stuart.

corCutOff

A numeric cutoff for the correlation of each dimension to the sequencing depth. If the dimension has a correlation to sequencing depth that is greater than the corCutOff, it will be excluded from analysis.

verbose

A boolean value that indicates whether printing TSNE output.

seed

A number to be used as the seed for random number generation. It is recommended to keep track of the seed used so that you can reproduce results downstream.

force

A boolean value that indicates whether to overwrite the relevant data in the ArchRProject object if the embedding indicated by name already exists.

threads

The number of threads to be used for parallel computing.

...

Additional parameters for computing the TSNE embedding to pass to Rtsne::Rtsne() (when method = "RTSNE") or to Seurat::RunTSNE() (when method = "FFRTSNE").