Project a feature matrix into a two-dimensional representation using PCA, MDS, t-SNE, or UMAP ready for plotting
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,
...
)
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
feature_calculations object containing the raw feature matrix produced by theft::calculate_features
character denoting the rescaling/normalising method to apply. Can be one of "zScore", "Sigmoid", "RobustSigmoid", "MinMax", or "MaxAbs". Defaults to "zScore"
Boolean whether to rescale into unit interval [0,1] after applying normalisation method. Defaults to FALSE
character specifying the low dimensional embedding method to use. Can be one of "PCA", "tSNE", "ClassicalMDS", "KruskalMDS", "SammonMDS", or "UMAP". Defaults to "PCA"
character defining 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"
integer to fix R's random number generator to ensure reproducibility. Defaults to 123
arguments to be passed to stats::prcomp or Rtsne::Rtsne, stats::cmdscale, MASS::isoMDS, MASS::sammon, or umap::umap depending on selection in low_dim_method
Trent Henderson
# \donttest{
library(theft)
features <- theft::calculate_features(theft::simData,
feature_set = "catch22")
pca <- project(features,
norm_method = "zScore",
low_dim_method = "PCA")
# }
Run the code above in your browser using DataLab