[!WARNING] unmixR is WORK IN PROGRESS. The fundamental structures & behavior may change. For the time being, use at your own risk.

Hyperspectral data are also called ‘imaging spectroscopy’ and ‘imaging spectrometer data’ depending upon the discipline. Such data consists of spectra collected over an x, y grid. Data sets like this are found in airborne land imaging studies, biomedical studies and art history investigations. The spectra are often visible, infrared, near-infrared, raman spectra or mass spectrometer data sets.

Installation

Installation: works easiest using remotes::install_git():

# Install latest version from GitHub
remotes::install_github("r-hyperspec/unmixR")

# Install a specific version from GitHub (for versions <=2.5)
remotes::install_github("r-hyperspec/unmixR", subdir = "pkg/unmixR", branch = "v2.0")

# Install a specific version from GitHub (for versions > 2.5)
remotes::install_github("r-hyperspec/unmixR", branch = "v2.7")

[!NOTE] Version tagged as v1.0 is the last stable version prior to significant changes. This tag was added for users who prefer to use an older version. However, the tag version v1.0 does not match the version in DESCRIPTION (see more on this in the issue). Starting from v2.0, the version in DESCRIPTION will match the tag version.

Example: N-FINDR workflow

library(unmixR)

# Load demo data
data("demo_data")

# Reduce data dimensionality with PCA
pca <- prcomp(demo_data)
x <- pca$x[, 1:2]

# Perform N-FINDR in reduced space
nf <- nfindr(x, p = 3)

# Get endmembers in original space
ems <- endmembers(nf, demo_data)

# Get endmembers in reduced space
ems_pca <- endmembers(nf, x)

# Calculate abundances using barycentric coordinates
# it works only in the reduced space
ab_bary <- abundances(nf, x, method = "bary")
# Same as: abundances(ems_pca, x, method = "bary")
# Same as: bary(ems_pca, x)

# Calculate abundances using NNLS
# it works in both spaces but it is better to be applied in the original space
ab_nnls <- abundances(nf, demo_data, method = "nnls", normalize = TRUE)
# Same as: nnls(ems, demo_data) / rowSums(nnls(ems, demo_data))
# Same as: `predict` method in older version of the package

Example: VCA workflow

library(unmixR)
data("demo_data")

# 1) Explicit VCA preprocessing
demo_red <- vca_dr(demo_data, p = 3)

# 2) Endmember extraction (indices-only result)
set.seed(123)
res_vca <- vca(demo_red, p = 3)

# 3) Endmembers in original or reduced space
ems_raw <- endmembers(res_vca, demo_data)
ems_red <- endmembers(res_vca, demo_red)

# Abundances from VCA model output
ab_vca <- abundances(res_vca, demo_red, method = "nnls")

Acknowledgements

Initial development of unmixR has been supported by Google Summer of Code 2013 (Conor McManus) and 2016 (Anton Belov). Thank you Google!

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie Actions (Grant Agreement 861122) as part of IMAGE-IN project.

GSOC 2016 logoHorizon 2020