matchms.Spikes module

class matchms.Spikes.Spikes(mz=None, intensities=None)[source]

Bases: object

Stores arrays of intensities and M/z values, with some checks on their internal consistency.

For example

import numpy as np
from matchms import Spikes

mz = np.array([10, 20, 30], dtype="float")
intensities = np.array([100, 20, 300], dtype="float")

peaks = Spikes(mz=mz, intensities=intensities)

Should output

[ 30. 300.]

Numpy array of m/z values.


Numpy array of peak intensity values.

__init__(mz=None, intensities=None)[source]

Initialize self. See help(type(self)) for accurate signature.

property intensities

getter method for intensities private variable

property mz

getter method for mz private variable

property to_numpy

getter method to return stacked numpy array of both peak mz and intensities