Learn R Programming

destiny (version 2.0.4)

DiffusionMap class: Create a diffusion map of cells

Description

The provided data can be a double matrix of expression data or a data.frame with all non-integer (double) columns being treated as expression data features (and the others ignored), or an ExpressionSet.

Usage

DiffusionMap(data, sigma = "local", k = find_dm_k(nrow(data) - 1L),
  n_eigs = min(20L, nrow(data) - 2L), density_norm = TRUE, ...,
  distance = c("euclidean", "cosine", "rankcor"), n_local = 5L,
  censor_val = NULL, censor_range = NULL, missing_range = NULL,
  vars = NULL, verbose = !is.null(censor_range), suppress_dpt = FALSE)

Arguments

data
Expression data to be analyzed. Provide vars to select specific columns other than the default: all double value columns
sigma
Diffusion scale parameter of the Gaussian kernel. One of 'local', 'global', a (numeric) global sigma or a Sigmas object. When choosing 'global', a global sigma will be calculated using find_sigmas. (Optional. default: 'local') A larger sigma might be necessary if the eigenvalues can not be found because of a singularity in the matrix
k
Number of nearest neighbors to consider (default: a guess betweeen 100 and \(n - 1\). See find_dm_k).
n_eigs
Number of eigenvectors/values to return (default: 20)
density_norm
logical. If TRUE, use density normalisation
...
All parameter after this are optional and have to be specified by name
distance
Distance measurement method. Euclidean distance (default), cosine distance (\(1-corr(c_1, c_2)\)) or rank correlation distance (\(1-corr(rank(c_1), rank(c_2))\)).
n_local
If sigma == 'local', the n_localth nearest neighbor determines the local sigma.
censor_val
Value regarded as uncertain. Either a single value or one for every dimension (Optional, default: censor_val)
censor_range
Uncertainity range for censoring (Optional, default: none). A length-2-vector of certainty range start and end. TODO: also allow \(2\times G\) matrix
missing_range
Whole data range for missing value model. Has to be specified if NAs are in the data
vars
Variables (columns) of the data to use. Specifying NULL will select all columns (default: All floating point value columns)
verbose
Show a progressbar and other progress information (default: do it if censoring is enabled)
suppress_dpt
Specify TRUE to skip calculation of necessary (but spacious) information for DPT in the returned object (default: FALSE)

Value

A DiffusionMap object:

Slots

eigenvalues
Eigenvalues ranking the eigenvectors
eigenvectors
Eigenvectors mapping the datapoints to n_eigs dimensions
sigmas
Sigmas object with either information about the find_sigmas heuristic run or just local or optimal_sigma.
data_env
Environment referencing the data used to create the diffusion map
eigenvec0
First (constant) eigenvector not included as diffusion component.
transitions
Transition probabilities. Can be NULL
d
Density vector of transition probability matrix
d_norm
Density vector of normalized transition probability matrix
k
The k parameter for kNN
n_local
The n_localth nearest neighbor is used to determine local kernel density
density_norm
Was density normalization used?
distance
Distance measurement method used.
censor_val
Censoring value
censor_range
Censoring range
missing_range
Whole data range for missing value model
vars
Vars parameter used to extract the part of the data used for diffusion map creation

See Also

DiffusionMap-methods to get and set the slots. find_sigmas to pre-calculate a fitting global sigma parameter

Examples

Run this code
data(guo)
DiffusionMap(guo)
DiffusionMap(guo, 13, censor_val = 15, censor_range = c(15, 40), verbose = TRUE)

Run the code above in your browser using DataLab