Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

msalign: Signal calibration and alignment by reference peaks

Project description

msalign - signal calibration and alignment

Build Status CircleCI Build status 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.

Installation

pip install msalign

or

pip install git+https://github.com/lukasz-migas/msalign.git

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


fname = r"./example_data/msalign_test_data.csv"
data = np.genfromtxt(fname, 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],
    )

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

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.

Files for msalign, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size msalign-0.1.2-py2.py3-none-any.whl (10.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size msalign-0.1.2.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page