Description Usage Arguments Details Value
tSpace is the main function for trajectory analysis. The algorithm is described in the publication Dermadi et al. 2018 pre-print available: doi: https://doi.org/10.1101/336313 Originally, it was developed for single cell analysis, however it can be applied on any type of large data.
1 2 3 4 |
df |
a data frame or a matrix of expression values, which contain information on data straucture, e.g. expression of variable genes, developmentally relevant genes/proteins, or significant principal components of your data. |
K |
an integer specifying the K-nearest-neighbors |
L |
an integer specifying the random L out of K-nearest-neighbors, L < K, usually L= 0.75*K |
D |
a string specfying metric for distance calculation. Supported: ’euclidean’, ’pearson_correlation’, ’manhattan’, ’chebyshev’, ’canberra’, ’braycurtis’, ’simple_matching_coefficient’, ’minkowski’, ’hamming’, ’mahalanobis’, ’jaccard_coefficient’, ’Rao_coefficient’ |
graph |
an integer specifying how many L-K-NN graphs will be used for final trajectory calculation |
trajectories |
an integer specifying how many trajectories will be calculatedl. Default value is 100, see ground_truth for more details |
wp |
an integer specifying the number of waypoints for trajectory refinement |
ground_truth |
a booolean (TRUE or FALSE) specifying if trajectories are calculated for every data point. As default tSpace calculates an aproximation using 100 trajectories, which is usually sufficient for understanding of developmental relations in single cell data. If set to TRUE, calculation time will be longer and trajectories parameter will be overridden. |
weights |
a string specfying method to calculate the weights for refinement of the trajectory distances. Supported: uniform, linear, quadratic and exponential. |
dr |
a string specifying type of embbeding for visualization. Options: 'pca', 'umap' or 'both'. 'pca' embbeds trajectory space matrix in principal components, 'umap' uses umap function with config parameter filled with umap.defaults modified for min_dist = 0.8 and metric = 'manhattan', for details see documentation of umap package, 'both' calculates pca and umap |
seed |
an integer specifying seed for set.seed function in order to have reproducible umap |
core_no |
and integer specifying number of cores for parallelization, check how many cores your machine has and adjust accordingly |
If you use it please cite: doi: https://doi.org/10.1101/336313
tSpace returns a list of objects: 1. **ts_file**: a data frame of pca and/or umap embbedings of trajectory space matrix and input data,
2. pca_tspace and/or **umap_tspace**: pca and/or UMAP objects. pca object contians all the outputs of pca analysis,
umap contians all the outputs of the umap analysis, see umap
3. **tspace_matrix**: trajectory space matrix with calculated distances. In case negative distances are calculated during knn graph computation, these will be aproximated to zero
for trajectory inference completion, and reported in an object **negative_distances**, and a message will be reported in console.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.