alignment
- deimos.alignment.agglomerative_clustering(features, dims=['mz', 'drift_time', 'retention_time'], tol=[2e-05, 0.03, 0.3], relative=[True, True, False])[source]
Cluster features within provided linkage tolerances. Recursively merges the pair of clusters that minimally increases a given linkage distance. See
sklearn.cluster.AgglomerativeClustering.- Parameters:
features (
DataFrameorDataFrame) – Input feature coordinates and intensities per sample.dims (str or list) – Dimensions considered in clustering.
tol (float or list) – Tolerance in each dimension to define maximum cluster linkage distance.
relative (bool or list) – Whether to use relative or absolute tolerances per dimension.
- Returns:
features – Features concatenated over samples with cluster labels.
- Return type:
DataFrame
- deimos.alignment.fit_spline(a, b, align='retention_time', **kwargs)[source]
Fit a support vector regressor to matched features.
- Parameters:
a (
DataFrame) – First set of input feature coordinates and intensities.b (
DataFrame) – Second set of input feature coordinates and intensities.align (str) – Dimension to align.
kwargs – Keyword arguments for support vector regressor (
sklearn.svm.SVR).
- Returns:
Interpolated fit of the SVR result.
- Return type:
interp1d
- deimos.alignment.match(a, b, dims=['mz', 'drift_time', 'retention_time'], tol=[5e-06, 0.015, 0.3], relative=[True, True, False])[source]
Identify features in b within tolerance of those in a . Matches are bidirectionally one-to-one by highest intensity.
- Parameters:
a (
DataFrame) – First set of input feature coordinates and intensities.b (
DataFrame) – Second set of input feature coordinates and intensities.dims (str or list) – Dimensions considered in matching.
tol (float or list) – Tolerance in each dimension to define a match.
relative (bool or list) – Whether to use relative or absolute tolerances per dimension.
- Returns:
a, b – Features matched within tolerances. E.g., a[i..n]`and `b[i..n] each represent matched features.
- Return type:
DataFrame
- deimos.alignment.tolerance(a, b, dims=['mz', 'drift_time', 'retention_time'], tol=[5e-06, 0.025, 0.3], relative=[True, True, False])[source]
Identify features in b within tolerance of those in a. Matches are potentially many-to-one.
- Parameters:
a (
DataFrame) – First set of input feature coordinates and intensities.b (
DataFrame) – Second set of input feature coordinates and intensities.dims (str or list) – Dimensions considered in matching.
tol (float or list) – Tolerance in each dimension to define a match.
relative (bool or list) – Whether to use relative or absolute tolerances per dimension.
- Returns:
a, b – Features matched within tolerances. E.g., a[i..n] and b[i..n] each represent matched features.
- Return type:
DataFrame