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 3.0.x (Backend in Rust & GUI Application)
Version 3.0.x brings major updates to EMPeaks, focusing on performance and usability:
- Backend in Rust: The core algorithms have been rewritten in Rust, achieving substantial speedups in execution time and enabling more efficient high-throughput analysis.
- GUI Application: We have developed a new, user-friendly GUI application. It provides an intuitive environment for interactive data visualization, parameter tuning, and peak fitting.
Installation
1. Install via Wheel from GitHub Releases (Recommended for v3.0.x)
We provide pre-compiled wheel (.whl) files for Python 3.11 and later. Download the appropriate .whl file for your operating system from the GitHub Releases page. Then navigate to the downloaded directory in your terminal and install it using pip:
-
Windows (x64)
pip install empeaks-3.0.0-cp311-abi3-win_amd64.whl
-
macOS (Universal2 for Intel & Apple Silicon)
pip install empeaks-3.0.0-cp311-abi3-macosx_*_universal2.whl
-
Linux (x86_64)
pip install empeaks-3.0.0-cp311-abi3-manylinux_*_x86_64.whl
2. Install via PyPI (Currently Outdated)
You can also install EMPeaks from PyPI using pip:
pip install EMPeaks
[!WARNING] Due to a current issue with PyPI, the
pip install EMPeakscommand may install an older version, and updating to v3.0.x via PyPI is temporarily unavailable. Please use the wheel installation from GitHub Releases to get the latest 3.0.x features.
Usage
After installation, you can launch the new GUI application by running the following command:
empeaks deck
Version 2.2.x (Deterministic Annealing & TSDC mixture model)
In version 2.2.x, fitting model of Thermally Stimulated Depolarization Current(TSDC) and Deterministic Annealing with Dirichlet prior for mixing ratio estimation is implemented.
You can refer the details of the implementation in these papers;
- Deterministic Annealing: Sci. Tech. Adv. Mater. meth. 4, 2373046 (2024).;
- TSDC modeling: Sci. Tech. Adv. Mater. meth. 5, 2441102 (2025).
TSDC modeling
TSDC modeling is available with a same way to use other models like Gaussian mixture models. You can test the model by example object as follows:
from EMPeaks import TSDCMixture
tsdc = TSDCMixture.TSDCMixtureModel()
examples = TSDCMixture.Tests.Example(K=4)
examples.adapted_em()
examples.leastsq()
The method of examples.adapted_em() executes fitting of TSDC mixture model via EM algorithm. The method of examples.leastsq_tau0() demonstrates the fitting of TSDC mixture model via least-square method for the variables of $E_a$, $T_p$, and $\pi$ in each component. $E_a$, $T_p$, and $\pi$ represent activation energy, peak temperature, and mixture ratio, respectively.
Deterministic Annealing
Deterministic Annealing is a kind of sparse modeling. We can select important peak component automatically by Dirichlet prior for mixture ratio. First, enough peak number $K$ should set. Dirichlet prior conducts mixture ratio of redundant components to zero. It is implemented in EMCore/_em_core.py. Deterministic annealing is available for all mixture models. For example, following code shows how to use deterministic annealing with Gaussian mixture models.
from EMPeaks import GaussianMixture
x = np.load("energy.dat")
y = np.load("intensity.dat")
gmm = GaussianMixture.GaussianMixtureModel(K=10, background='linear')
gmm.Dirichlet_alpha = 0.5
gmm.deterministic_annealing(x, y)
In default, Dirichlet_alpha=1.0. Please change it to the number less than 1.0 if you want to introduce it, for example, 0.5.
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-2023 National Institute of Advanced Industrial Science and Technology (AIST)
© 2024-2026 Yasunobu Ando in Science Tokyo
Release files for empeaks 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| empeaks-3.0.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details |
| empeaks-3.0.0-cp311-abi3-manylinux_2_28_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| empeaks-3.0.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 | Details |
Total release size: 2.1 MB
Release files / empeaks-3.0.0-cp311-abi3-win_amd64.whl
| Download URL | empeaks-3.0.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 566.1 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0b091299d93850405a997c12c1008c0b15af40260f142b4ac8bbbac69d877f36
|
|
BLAKE2b-256 checksum How to use checksums |
db1b2c85003c4ce5b01d27cdffc7113d24675b5029caf86b4d34ae9f617f9804
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / empeaks-3.0.0-cp311-abi3-manylinux_2_28_x86_64.whl
| Download URL | empeaks-3.0.0-cp311-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 595.1 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e5db1755918cc92d09194ca06daabd95b075d22a8b783cbeb3cc012a50b2ef43
|
|
BLAKE2b-256 checksum How to use checksums |
3bae2d29bfa0b4c39746266783dc7ea5c00649bcac416f8950f9702ae8253278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / empeaks-3.0.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | empeaks-3.0.0-cp311-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 982.4 kB |
| Tags | CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
188239c7428cfc53f39914b03bb85bfdba6a04b34629db78183aaca3b61a645b
|
|
BLAKE2b-256 checksum How to use checksums |
3fd855085d1aa781718d892c0e98a5afda206575c5923ab4d7742879b5470308
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|