immunr_pca: Dimensionality reduction

View source: R/dimensions.R

immunr_pcaR Documentation

Dimensionality reduction

Description

Collects a set of principal variables, reducing the number of not important variables to analyse. Dimensionality reduction makes data analysis algorithms work faster and sometimes more accurate, since it also reduces noise in the data. Currently available methods are:

- immunr_pca performs PCA (Principal Component Analysis) using prcomp;

- immunr_mds performs MDS (Multi-Dimensional Scaling) using isoMDS;

- immunr_tsne performs tSNE (t-Distributed Stochastic Neighbour Embedding) using Rtsne.

Usage

immunr_pca(.data, .scale = default_scale_fun, .raw = TRUE, .orig = FALSE, .dist = FALSE)

immunr_mds(.data, .scale = default_scale_fun, .raw = TRUE, .orig = FALSE, .dist = TRUE)

immunr_tsne(.data, .perp = 1, .dist = TRUE, ...)

Arguments

.data

A matrix or a data frame with features, distance matrix or output from repOverlapAnalysis or geneUsageAnalysis functions.

.scale

A function to apply to your data before passing it to any of dimensionality reduction algorithms. There is no scaling by default.

.raw

If TRUE then returns the non-processed output from dimensionality reduction algorithms. Pass FALSE if you want to visualise results.

.orig

If TRUE then returns the original result from algorithms. Pass FALSE if you want to visualise results.

.dist

If TRUE then assumes that ".data" is a distance matrix.

.perp

The perplexity parameter for Rtsne. Sepcifies the number of neighbours each data point must have in the resulting plot.

...

Other parameters passed to Rtsne.

Value

immunr_pca - an output from prcomp.

immunr_mds - an output from isoMDS.

immunr_tsne - an output from Rtsne.

See Also

vis.immunr_pca for visualisations.

Examples

data(immdata)
gu <- geneUsage(immdata$data)
gu[is.na(gu)] <- 0
gu <- t(as.matrix(gu[, -1]))
immunr_pca(gu)
immunr_mds(dist(gu))
immunr_tsne(dist(gu))

immunomind/immunarch documentation built on March 20, 2024, 12:01 p.m.