Skip to main content

msalign: Signal calibration and alignment by reference peaks

Project description

msalign - signal calibration and alignment

Tests codecov 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

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

png

Zoom-in on each peak the spectrum was aligned against

png

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.

Source Distribution

msalign-0.2.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

msalign-0.2.0-py2.py3-none-any.whl (17.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file msalign-0.2.0.tar.gz.

File metadata

  • Download URL: msalign-0.2.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for msalign-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cd8b99b02d3d1024753c6bd355e5c1189003e0645041d957a3cd3c23da583d2f
MD5 d59c3c586be60e4ddd454eef68a364b1
BLAKE2b-256 7405421944ee5c4a924317dd09d7b4bbe5b00aac8af03666bd2c870bbf14e8e5

See more details on using hashes here.

File details

Details for the file msalign-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: msalign-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for msalign-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d603ef7c6adb7b479c80c342872e1f64ba7fc739d07f4e4200901e8e92b7107f
MD5 a21f6100e4132969563801dfda0dcc09
BLAKE2b-256 12befe5f21728919f19d98275c0d2157c061c830db7ebfbe0275c07c090e007b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page