'high-throughput spectrum peak modeling tools by using Spectrum adapted EM algorithms'
Project description
EMPeaks
This package is for high-throughput peak analysis by using Spectrum Adapted EM algorithm. Please refer the following paper when using this package: Sci. Tech. Adv. Mater. 20, 733-735 (2019).; Sci. Tech. Adv. Mater. method 1, 45 (2021).
version 2.1.x (Background Subtraction)
In version 2.1.x, Automated background subtraction is implemented. Following background models are available now.
- uniform: uniform background model
- linear: linear background model (positive gradient)
- ramp_sum: Ramp-Sum background model
The details of these models are explained in this paper, Sci. Tech. Adv. Mater. Method 3, 2159753 (2023).
Background models are easily implemented into model instance as follows;
from EMPeaks import GaussianMixture
gmm = GaussianMixture.GaussianMixtureModel(K=3, background='uniform')
Keywords to set the background models are uniform
, linear
, ramp_sum
.
version 2.0.x
In version 2.0.x, Gaussian Mixture Model (GMM), Lorentzian Mixture Model (LMM), Pseudo Voigt Mixture model (PVMM), and Doniach-Sunijic Miture model (DSMM). In principle, these combination models are also available but not implemented yet.
From this version, each model has the same functions but differ from version 1, though functions and classes in version 1 still work. Sample codes to import these models are followings for instance:
from EMPeaks import GaussianMixture
gmm = GaussianMixture.GaussianMixtureModel(K=3)
from EMPeaks import LorentzianMixture
lmm = LorentzianMixture.LorentzianMixtureModel(K=2)
Mixture model object includes a single model object. These packages also have a class for single Gaussian, Lorentizan, pseudo Voigt, and DS models. For example,
from EMPeaks import GaussianMixture
gm = GaussianMixture.Gaussian(x_min=-100, x_max=100, sigma_min=0.1, sigma_max=10)
In version 2, we do not implement the class for optimization. Instead,all model classes has functions to optimize the parameters to fit the target data.
from EMPeaks import GaussianMixture
import numpy as np
x = np.load("energy.dat")
y = np.load("intensity.dat")
gmm = GaussianMixture.GaussianMixtureModel(K=3)
gmm.fit(x, y)
# if you want to sample some initial guess and choose the highest likelihood model,
gmm.sampling(x, y, trial=10)
After fitting, you can plot both raw data and fitted model as follows:
gmm.plot(x, y)
© 2020-2021 National Institute of Advanced Industrial Science and Technology (AIST)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file EMPeaks-2.1.0.tar.gz
.
File metadata
- Download URL: EMPeaks-2.1.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 644418d8e3cdc7a5b1aeff2b72b3830fd53b2ff71c8165cabf4101dc488b9546 |
|
MD5 | 8d2cce308ffbcce13d529821efff225d |
|
BLAKE2b-256 | dbdc6967b976aebd7d0e2811810a564c22d4deb6a6cdfdd7dc88572a733e7cb6 |
File details
Details for the file EMPeaks-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: EMPeaks-2.1.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 012511f01b7ce7c06f922b1675599f10e491f4450ba6c320520a646e86608106 |
|
MD5 | 8bd885844efb3436da9265bf03df59c1 |
|
BLAKE2b-256 | d67951ec490af9abab2d613d500d01f48643779a0e9781c42c74f4ff21c09ac5 |