Target list utilities¶
Everything related to target lists.
check_targets(targets)
¶
Check if targets are formatted correctly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
targets |
DataFrame
|
Target list DataFrame to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if all checks pass, else False. |
Source code in src/ms_mint/targets.py
convert_to_seconds(targets)
¶
Convert retention time units to seconds.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
targets |
DataFrame
|
Mint target list to modify in-place. |
required |
Source code in src/ms_mint/targets.py
diff_targets(old_pklist, new_pklist)
¶
Get the difference between two target lists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
old_pklist |
DataFrame
|
Original target list. |
required |
new_pklist |
DataFrame
|
New target list to compare against the original. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame containing only the targets that are new or changed. |
Source code in src/ms_mint/targets.py
fill_missing_rt_values(targets)
¶
Fill missing rt values with mean of rt_min and rt_max.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
targets |
DataFrame
|
Mint target list to modify in-place. |
required |
Source code in src/ms_mint/targets.py
gen_target_grid(masses, dt, rt_max=10, mz_ppm=10, intensity_threshold=0)
¶
Create a target grid from a list of masses.
Generates a grid of targets by combining each mass with a series of retention time windows spanning from 0 to rt_max.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
masses |
List[float]
|
List of target m/z values. |
required |
dt |
float
|
Size of peak windows in time dimension [min]. |
required |
rt_max |
float
|
Maximum retention time to include. |
10
|
mz_ppm |
float
|
Width of peak window in m/z dimension [ppm]. |
10
|
intensity_threshold |
float
|
Minimum intensity threshold for peaks. |
0
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame containing generated target list. |
Source code in src/ms_mint/targets.py
read_targets(fns, ms_mode='negative')
¶
Extract peak data from files containing peak definitions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fns |
Union[str, List[str]]
|
List of filenames of target lists or a single filename. |
required |
ms_mode |
str
|
Mass spectrometry ionization mode, either "negative" or "positive". |
'negative'
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame containing standardized target information from all input files. |
Source code in src/ms_mint/targets.py
standardize_targets(targets, ms_mode='neutral')
¶
Standardize target list format and units.
This function: - Updates the target lists to newest format - Ensures peak labels are strings - Replaces np.nan with None - Converts retention times to seconds - Fills missing values with reasonable defaults
Parameters:
Name | Type | Description | Default |
---|---|---|---|
targets |
DataFrame
|
DataFrame in target-list format. |
required |
ms_mode |
str
|
Ionization mode. Options are "neutral", "positive", or "negative". |
'neutral'
|
Returns:
Type | Description |
---|---|
DataFrame
|
DataFrame in standardized target-list format. |
Raises:
Type | Description |
---|---|
AssertionError
|
If there are duplicate column names in the input DataFrame. |
Source code in src/ms_mint/targets.py
options: show_root_heading: true show_root_full_path: true show_submodules: true members_order: source