msalign: Signal calibration and alignment by reference peaks
Project description
msalign - signal calibration and alignment
This package was inspired by MATLAB's msalign function which allows alignment of multiple signals to reference peaks.
Installation
Install from PyPi
pip install msalign
Install directly from GitHub
pip install -e git+https://github.com/lukasz-migas/msalign.git
Install in development mode
python setup.py develop
Usage
Usage is relatively straightforward. Simply import the function msalign
from the package and provide xvals
, zvals
and peaks
. Other parameters can be passed-in using kwargs
.
import numpy as np
from msalign import msalign
filename = r"./example_data/msalign_test_data.csv"
data = np.genfromtxt(filename, delimiter=",")
xvals = data[1:, 0]
zvals = data[1:, 1:].T
peaks = [3991.4, 4598, 7964, 9160]
kwargs = dict(
iterations=5,
weights=[60, 100, 60, 100],
resolution=100,
grid_steps=20,
ratio=2.5,
shift_range=[-100, 100],
only_shift=False
)
zvals_new = msalign(xvals, zvals, peaks, **kwargs)
Reference
Monchamp, P., Andrade-Cetto, L., Zhang, J.Y., and Henson, R. (2007) Signal Processing Methods for Mass Spectrometry. In Systems Bioinformatics: An Engineering Case-Based Approach, G. Alterovitz and M.F. Ramoni, eds. Artech House Publishers).
Project details
Release history Release notifications | RSS feed
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
Hashes for msalign-0.1.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20ea5f5a0b9e37ed98fbbc2bdef68d830a8b0769c0c0e9174f120a91b52e2d69 |
|
MD5 | dcecce8e8b3e670e5064b2f1801ff7c4 |
|
BLAKE2b-256 | c750ce50911c301b5c78a14dc6e15d9238c9829e22ef573a3ad8383e6055ee03 |