% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/tSNE.R
\docType{methods}
\name{tSNE}
\alias{tSNE}
\alias{tSNE,daFrame-method}
\title{Run t-SNE}
\usage{
tSNE(x, ...)

\S4method{tSNE}{daFrame}(x, cols_to_use = NULL, n = 1000, seed = 42)
}
\arguments{
\item{x}{a \code{\link{daFrame}}.}

\item{...}{optional arguments.}

\item{cols_to_use}{a character vector. Specifies which antigens to use for clustering.
If NULL, the function will attempt to use the \code{type_markers(x)}.}

\item{n}{numeric. Specifies the number of cells to downsample to per sample.}

\item{seed}{numeric. Specifies the seed to be set before sampling}
}
\value{
Writes the tSNE coordinates and the indicies of the events used 
for their computation into the metadata slot of the input \code{daFrame}.
}
\description{
Runs t-SNE dimensionality reduction on a \code{\link{daFrame}}.
}
\examples{
# construct daFrame
data(PBMC_fs, PBMC_panel, PBMC_md)
re <- daFrame(PBMC_fs, PBMC_panel, PBMC_md)

# run t-SNE
lineage <- c("CD3", "CD45", "CD4", "CD20", "CD33", 
    "CD123", "CD14", "IgM", "HLA_DR", "CD7")
re <- tSNE(re, cols_to_use=lineage, n=50)

par(pty="s")
tsne <- S4Vectors::metadata(re)$tsne$Y
plot(tsne, pch=20)

}
\references{
Nowicka M, Krieg C, Weber LM et al. 
CyTOF workflow: Differential discovery in 
high-throughput high-dimensional cytometry datasets.
\emph{F1000Research} 2017, 6:748 (doi: 10.12688/f1000research.11622.1)
}
\seealso{
\code{\link{plotSNE}}
}
\author{
Helena Lucia Crowell \email{crowellh@student.ethz.ch}
}
