
Project a feature matrix into a two-dimensional representation using PCA, MDS, t-SNE, or UMAP ready for plotting
Source:R/project.R
project.RdProject a feature matrix into a two-dimensional representation using PCA, MDS, t-SNE, or UMAP ready for plotting
Usage
project(
data,
norm_method = c("zScore", "Sigmoid", "RobustSigmoid", "MinMax", "MaxAbs"),
unit_int = FALSE,
low_dim_method = c("PCA", "tSNE", "ClassicalMDS", "KruskalMDS", "SammonMDS", "UMAP"),
na_removal = c("feature", "sample"),
seed = 123,
...
)
reduce_dims(
data,
norm_method = c("zScore", "Sigmoid", "RobustSigmoid", "MinMax", "MaxAbs"),
unit_int = FALSE,
low_dim_method = c("PCA", "tSNE", "ClassicalMDS", "KruskalMDS", "SammonMDS", "UMAP"),
na_removal = c("feature", "sample"),
seed = 123,
...
)Arguments
- data
feature_calculationsobject containing the raw feature matrix produced bytheft::calculate_features- norm_method
characterdenoting the rescaling/normalising method to apply. Can be one of"zScore","Sigmoid","RobustSigmoid","MinMax", or"MaxAbs". Defaults to"zScore"- unit_int
Booleanwhether to rescale into unit interval[0,1]after applying normalisation method. Defaults toFALSE- low_dim_method
characterspecifying the low dimensional embedding method to use. Can be one of"PCA","tSNE","ClassicalMDS","KruskalMDS","SammonMDS", or"UMAP". Defaults to"PCA"- na_removal
characterdefining the way to deal with NAs produced during feature calculation. Can be one of"feature"or"sample"."feature"removes all features that produced any NAs in any sample, keeping the number of samples the same."sample"omits all samples that produced at least one NA. Defaults to"feature"- seed
integerto fix R's random number generator to ensure reproducibility. Defaults to123- ...
arguments to be passed to
stats::prcomporRtsne::Rtsne,stats::cmdscale,MASS::isoMDS,MASS::sammon, orumap::umapdepending on selection inlow_dim_method
Value
object of class feature_projection which is a named list containing the feature_calculations data supplied to the function, the wide matrix of filtered data, a tidy data.frame of the projected 2-D data, and the model fit object
Examples
# \donttest{
library(theft)
features <- theft::calculate_features(theft::simData,
feature_set = "catch22")
#> Running computations for catch22...
pca <- project(features,
norm_method = "zScore",
low_dim_method = "PCA")
# }