filters
- deimos.filters.count(a, size, nonzero=False)[source]
N-dimensional convolution of a counting filter.
- Parameters:
a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
nonzero (bool) – Only count nonzero values.
- Returns:
Filtered intensity data.
- Return type:
array
- deimos.filters.kurtosis_pdf(edges, a, size)[source]
N-dimensional convolution of a kurtosis probability density function filter.
- Parameters:
edges (list of
array) – Edges coordinates along each grid axis.a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered edge data.
- Return type:
list of
array
- deimos.filters.matched_gaussian(a, size)[source]
N-dimensional convolution of a matched Gaussian filter.
- Parameters:
a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered intensity data.
- Return type:
array
- deimos.filters.maximum(a, size)[source]
N-dimensional convolution of a maximum filter.
- Parameters:
a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered intensity data.
- Return type:
array
- deimos.filters.mean(a, size)[source]
N-dimensional convolution of a mean filter.
- Parameters:
a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered intensity data.
- Return type:
array
- deimos.filters.mean_pdf(edges, a, size)[source]
N-dimensional convolution of a mean probability density function filter.
- Parameters:
edges (list of
array) – Edges coordinates along each grid axis.a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered edge data.
- Return type:
list of
array
- deimos.filters.minimum(a, size)[source]
N-dimensional convolution of a minimum filter.
- Parameters:
a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered intensity data.
- Return type:
array
- deimos.filters.skew_pdf(edges, a, size)[source]
N-dimensional convolution of a skew probability density function filter.
- Parameters:
edges (list of
array) – Edges coordinates along each grid axis.a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered edge data.
- Return type:
list of
array
- deimos.filters.smooth(features, index=None, factors=None, dims=['mz', 'drift_time', 'retention_time'], radius=[0, 1, 1], iterations=1, tol=0.0)[source]
Smooth data by sparse mean filtration.
- Parameters:
features (
DataFrame) – Input feature coordinates and intensities.index (dict) – Index of features in original data array.
factors (dict) – Unique sorted values per dimension.
dims (str or list) – Dimensions to perform peak detection in.
radius (float or list) – Radius of the sparse filter in each dimension. Values less than zero indicate no connectivity in that dimension.
iterations (int) – Maximum number of smoothing iterations to perform.
tol (float) – Stopping criteria based on residual with previous iteration. Selecting zero will perform all specified iterations.
- Returns:
Smoothed feature coordinates and intensities.
- Return type:
DataFrame
- deimos.filters.sparse_mean_filter(idx, V, radius=[0, 1, 1])[source]
Sparse implementation of a mean filter.
- Parameters:
idx (
array) – Edge indices for each dimension (MxN).V (
array) – Array of intensity data (Mx1).radius (float or list) – Radius of the sparse filter in each dimension. Values less than zero indicate no connectivity in that dimension.
- Returns:
Filtered intensities (Mx1).
- Return type:
array
- deimos.filters.sparse_median_filter(idx, V, radius=[0, 1, 1])[source]
Sparse implementation of a median filter.
- Parameters:
idx (
array) – Edge indices for each dimension (MxN).V (
array) – Array of intensity data (Mx1).radius (float or list) – Radius of the sparse filter in each dimension. Values less than zero indicate no connectivity in that dimension.
- Returns:
Filtered intensities (Mx1).
- Return type:
array
- deimos.filters.sparse_upper_star(idx, V)[source]
Sparse implementation of an upper star filtration. :param idx: Edge indices for each dimension (MxN). :type idx:
array:param V: Array of intensity data (Mx1). :type V:array- Returns:
idx (
array) – Index of filtered points (Mx1).persistence (
array) – Persistence of each filtered point (Mx1).
- deimos.filters.sparse_weighted_mean_filter(idx, V, w, radius=[1, 1, 1], pindex=None)[source]
Sparse implementation of a weighted mean filter.
- Parameters:
idx (
array) – Edge indices for each dimension (MxN).V (
array) – Array of edge data (MxN).w (
array) – Array of intensity data (Mx1).radius (float or list) – Radius of the sparse filter in each dimension. Values less than one indicate no connectivity in that dimension.
pindex (
array) – Index of points to evaluate the weighted mean.
- Returns:
Filtered edges (MxN).
- Return type:
array
- deimos.filters.std(a, size)[source]
N-dimensional convolution of a standard deviation filter.
- Parameters:
a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered intensity data.
- Return type:
array
- deimos.filters.std_pdf(edges, a, size)[source]
N-dimensional convolution of a standard deviation probability density function filter.
- Parameters:
edges (list of
array) – Edges coordinates along each grid axis.a (
array) – N-dimensional array of intensity data.size (int or list) – Size of the convolution kernel in each dimension.
- Returns:
Filtered edge data.
- Return type:
list of
array