Skip to content

Quickstart

Here’s a minimal working example to get started with ms-mint in just a few steps:

1. Install the package

pip install ms-mint

2. Import the library

If you're using a script:

from ms_mint.Mint import Mint
mint = Mint()

If you're using a Jupyter notebook:

%pylab inline
from ms_mint.notebook import Mint
mint = Mint()

3. Load your mass spectrometry data files

You can load individual files:

mint.ms_files = [
    './input/sample1.mzML',
    './input/sample2.mzXML',
]

Or use wildcards to load multiple files:

mint.load_files('./input/*.mzML')

4. Load your target list

From a CSV file:

mint.load_targets('targets.csv')

Or directly from a pandas DataFrame:

import pandas as pd

targets = pd.read_csv('targets.csv')
mint.targets = targets

5. Run the analysis

mint.run()

If you're working with thousands of files, save results directly to a file to save memory:

mint.run(fn='results.csv')

6. View results

mint.results

Optional: Optimize retention time ranges

For better peak detection, especially if your RT values are estimates:

mint.opt.rt_min_max(
    peak_labels=['Xanthine', 'Succinate'],
    plot=True
)

You’re now ready to process large-scale targeted metabolomics datasets with ms-mint!

Continue with visualization or the structure of target lists.