Skip to main content

msalign: Signal calibration and alignment by reference peaks

Project description

msalign - signal calibration and alignment

Tests codecov Requirements Status CodeFactor Netlify Status

Wheel PyPI Versions Downloads

This package was inspired by MATLAB's msalign function which allows alignment of multiple signals to reference peaks.


Install from PyPi

pip install msalign

Install directly from GitHub

pip install -e git+

Install in development mode

python develop


Usage is relatively straightforward. Simply import msalign from the package and provide x, array and peaks values. msalign accepts a lot of other parameters that might improve your alignment - simply provide them as keyword parameters.

import numpy as np
from msalign import msalign

filename = r"./example_data/msalign_test_data.csv"
data = np.genfromtxt(filename, delimiter=",")
x = data[1:, 0]
array = data[1:, 1:].T
peaks = [3991.4, 4598, 7964, 9160]

aligned = msalign(x, array, peaks, weights=[60, 100, 60, 100], only_shift=False)


Zoom-in on each peak the spectrum was aligned against



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).

MATLAB's msalign

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

msalign-0.1.9.tar.gz (15.6 kB view hashes)

Uploaded source

Built Distribution

msalign-0.1.9-py2.py3-none-any.whl (19.4 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page