This function computes dimensional reduction representations to a specified number of dimensions using a number of different algorithms: t-SNE, cmd, diffusion maps, umap
compdr(
x,
z = NULL,
m = c("tsne", "cmd", "umap"),
k = 2,
tsne.perplexity = 30,
umap.pars = NULL,
seed = 12345
)
expression data frame with genes as rows and cells as columns. Gene IDs should be given as row names and cell IDs should be given as column names. This can be a reduced expression table only including the features (genes) to be used in the analysis.
Matrix containing cell-to-cell distances to be used in the fate bias computation. Default is NULL
. In this case, a correlation-based distance is computed from x
by 1 - cor(x)
a vector of dimensional reduction representations to be computed. The following representations can be computed: cmd
(classical multidimensional scaling), dm
(diffusion map), tsne
(t-SNE map), umap
(umap). The default value of m is c("cmd","tsne","umap")
. Any subset of methods can be selected.
vector of integers representing the dimensions for which the dimensional reduction representations will be computed. Default value is 2
.
positive number. Perplexity used in the t-SNE computation. Default value is 30.
umap parameters. See umap package, umap.defaults
. Default is NULL
and umap.defaults
are used. umap.pars$input
is automatically set to "dist"
, since the umap is computed for the distance object.
integer seed for initialization. If equal to NULL
then each run will yield slightly different results due to the randomness of the random forest algorithm. Default is NULL
A two-dimensional list with the dimensional reduction representation stored as data frames as components. Component names for the first dimension are given by one of the following algorithms:
classical multidimensional scaling computed by the cmdscale
function of the stats package.
t-SNE map computed by the Rtsne
function of the Rtsne package.
umap computed by the umap
function of the umap package.
Component names of the second dimension are a concatenation of a capital D and an integer number of the dimension. There is one component for each dimension in k.
# NOT RUN {
x <- intestine$x
dr <- compdr(x,z=NULL,m="cmd",k=2,tsne.perplexity=30)
plot(dr[["cmd"]][["D2"]],pch=20,col="grey")
# }
Run the code above in your browser using DataLab