matchms.Fragments module

class matchms.Fragments.Fragments(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 Fragments

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

peaks = Fragments(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]
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