Full API

API

CanonicalCorrelationAnalysis(A, B)

Returns a CanonicalCorrelationAnalysis object which contains (U, V, r) from Arrays A and B. Currently Untested for correctness but should compute....

source
GaussianBand(sigma,amplitude,center)

Constructs a Gaussian kernel generator.

source
(B::GaussianBand)(X::Float64)

Returns the scalar probability associated with a GaussianBand object (kernel) at a location in space(X).

source
LDA(X, Y; Factors = 1)

Compute's a LinearDiscriminantAnalysis transform from x with a user specified number of latent variables(Factors). Returns an LDA object.

source
( model::LDA )( Z; Factors = length(model.Values) )

Calling a LDA object on new data brings the new data Z into the LDA basis.

source
LorentzianBand(gamma,amplitude,center)

Constructs a Lorentzian kernel generator.

source
(B::LorentzianBand)(X::Float64)

Returns the probability associated with a LorentzianBand object (kernel) at a location in space(X).

source
PCA(X; Factors = minimum(size(X)) - 1)

Compute's a PCA from x using LinearAlgebra's SVD algorithm with a user specified number of latent variables(Factors). Returns a PCA object.

source
(T::PCA)(Z::Array; Factors = length(T.Values), inverse = false)

Calling a PCA object on new data brings the new data Z into or out of (inverse = true) the PCA basis.

source
(U::Universe)(Band...)

A Universe objects internal "spectra" can be updated to include the additive contribution of many Band-like objects.

source
Universe(mini, maxi; width = nothing, bins = nothing)

Creates a 1-D discretized segment that starts at mini and ends at maxi. The width of the bins for the discretization can either be provided or inferred from the number of bins. Returns a Universe object.

source
(U::Universe)(Band::Union{ GaussianBand, LorentzianBand})

A Universe objects internal "spectra" can be updated to include the additive contribution of any Band-like object.

source
AssessHealth( X )

Returns a somewhat detailed Dict containing information about the 'health' of a dataset. What is included is the following: - PercentMissing: percent of missing entries (includes nothing, inf / nan) in the dataset - EmptyColumns: the columns which have only 1 value - RankEstimate: An estimate of the rank of X - (optional)Duplicates: returns the rows of duplicate observations

source
ExplainedVariance(lda::LDA)

Calculates the explained variance of each singular value in an LDA object.

source
ExplainedVariance(PCA::PCA)

Calculates the explained variance of each singular value in a pca object.

source
HLDA(X, YHOT; K = 1, Factors = 1)

Compute's a Hierarchical LinearDiscriminantAnalysis transform from x with a user specified number of latent variables(Factors). The adjacency matrices are created from K nearest neighbors.

Returns an LDA object. Note: this can be used with any other LDA functions such as Gaussian discriminants or explained variance.

Lu D, Ding C, Xu J, Wang S. Hierarchical Discriminant Analysis. Sensors (Basel). 2018 Jan 18;18(1). pii: E279. doi: 10.3390/s18010279.

source
PCA_NIPALS(X; Factors = minimum(size(X)) - 1, tolerance = 1e-7, maxiters = 200)

Compute's a PCA from x using the NIPALS algorithm with a user specified number of latent variables(Factors). The tolerance is the minimum change in the F norm before ceasing execution. Returns a PCA object.

source
RAFFT(raw, reference; maxlags::Int = 500, lookahead::Int = 1, minlength::Int = 20, mincorr::Float64 = 0.05)

RAFFT corrects shifts in the raw spectral bands to be similar to those in a given reference spectra through the use of "recursive alignment by FFT". It returns an array of corrected spectra/chromatograms. The number of maximum lags can be specified, the lookahead parameter ensures that additional recursive executions are performed so the first solution found is not preemptively accepted, the minimum segment length(minlength) can also be specified if FWHM are estimable, and the minimum cross correlation(mincorr) for a match can dictate whether peaks were found to align or not.

Note This method works best with flat baselines because it repeats last known values when padding aligned spectra. It is highly efficient, and in my tests does a good job, but other methods definitely exist. Let me know if other peak Alignment methods are important for your work-flow, I'll see if I can implement them.

Application of Fast Fourier Transform Cross-Correlation for the Alignment of Large Chromatographic and Spectral Datasets Jason W. H. Wong, Caterina Durante, and, Hugh M. Cartwright. Analytical Chemistry 2005 77 (17), 5655-5661

source
findpeaks( vY; m = 3)

Finds the indices of peaks in a vector vY with a window span of 2m. Original R function by Stas_G:(https://stats.stackexchange.com/questions/22974/how-to-find-local-peaks-valleys-in-a-series-of-data) This version is based on a C++ variant by me.

source