Skip to content

Start

This package provides Python bindings to the peak picker from findMF.

Installation

pip install findmfpy

Reference

findmfpy.pick_peaks

pick_peaks(
    mz_arr: numpy.typing.NDArray[numpy.float64],
    int_arr: numpy.typing.NDArray[numpy.float64],
    resolution: float = 10000.0,
    width: float = 2.0,
    int_width: float = 2.0,
    int_threshold: float = 10.0,
    area: bool = True,
    max_peaks: int = 0,
) -> tuple[
    numpy.typing.NDArray[numpy.float64],
    numpy.typing.NDArray[numpy.float64],
]

Picks peaks from a mass spectrum.

Parameters:

Name Type Description Default
mz_arr numpy.typing.NDArray[numpy.float64]

The m/z array.

required
int_arr numpy.typing.NDArray[numpy.float64]

The intensity array.

required
resolution float

The resolution of the instrument.

10000.0
width float

The width of the peak.

2.0
int_width float

The width of the intensity.

2.0
int_threshold float

The intensity threshold.

10.0
area bool

Whether to calculate the area instead of intensity.

True
max_peaks int

The maximum number of peaks to return.

0

Returns:

Name Type Description
0 numpy.typing.NDArray[numpy.float64]

The m/z array of the peaks.

1 numpy.typing.NDArray[numpy.float64]

The intensity array of the peaks.

findmfpy.pick_peaks_diagnostic

pick_peaks_diagnostic(
    mz_arr: numpy.typing.NDArray[numpy.float64],
    int_arr: numpy.typing.NDArray[numpy.float64],
    resolution: float = 10000.0,
    width: float = 2.0,
    int_width: float = 2.0,
    int_threshold: float = 10.0,
    area: bool = True,
    max_peaks: int = 0,
) -> tuple[
    numpy.typing.NDArray[numpy.float64],
    numpy.typing.NDArray[numpy.float64],
    dict[str, numpy.typing.NDArray[numpy.float64]],
]

Picks peaks from a mass spectrum, and returns some additional diagnostic information of the peak picker.

Parameters:

Name Type Description Default
mz_arr numpy.typing.NDArray[numpy.float64]

The m/z array.

required
int_arr numpy.typing.NDArray[numpy.float64]

The intensity array.

required
resolution float

The resolution of the instrument.

10000.0
width float

The width of the peak.

2.0
int_width float

The width of the intensity.

2.0
int_threshold float

The intensity threshold.

10.0
area bool

Whether to calculate the area instead of intensity.

True
max_peaks int

The maximum number of peaks to return.

0

Returns:

Name Type Description
0 numpy.typing.NDArray[numpy.float64]

The m/z array of the peaks.

1 numpy.typing.NDArray[numpy.float64]

The intensity array of the peaks.

2 dict[str, numpy.typing.NDArray[numpy.float64]]

Diagnostic information from the peak picker internals.