"""Run FeatureFinderMetabo on a small mzXML file."""

from pathlib import Path

import emzed

peak_map = emzed.PeakMap.load(Path("data") / "test.mzXML")
peak_map = peak_map.extract(mzmin=255, mzmax=262)

# Same API also supports MS2-oriented runs, e.g.:
# ms_level=2 and split_by_precursors_mz_tol=<tolerance>.
peaks = emzed.run_feature_finder_metabo(
    peak_map,
    verbose=False,
    mtd_noise_threshold_int=10000,
)

print(f"detected {len(peaks)} features")
print()
print("columns:")
for name in peaks.col_names:
    print(f"  - {name}")
print()

peaks.set_col_format("peakmap", None)
print(peaks)
