proteobench.io.params.metamorpheus module#

Extract parameters from a MetaMorpheus TOML file and convert them to a pandas Series.

proteobench.io.params.metamorpheus.extract_params(file_path_1, file_path_2, json_file='/home/docs/checkouts/readthedocs.org/user_builds/proteobench/envs/v0.16.4/lib/python3.11/site-packages/proteobench/io/params/json/Quant/quant_lfq_DDA_ion.json') ProteoBenchParameters[source]#
proteobench.io.params.metamorpheus.format_tolerances(tolerance: str) str[source]#

Format mass tolerance values from a string to a standardized format.

Parameters:

tolerance (str) – Mass tolerance in string format (e.g., “±20.0000 PPM”)

Returns:

Formatted mass tolerance as a string.

Return type:

str

proteobench.io.params.metamorpheus.get_incomplete_upload_warning(files: list) str[source]#

Return a user-facing warning string when fewer than two MetaMorpheus files are uploaded.

Parameters:

files (list) – List of uploaded file objects (expected to contain exactly one element).

Returns:

Warning message describing which file is missing.

Return type:

str

proteobench.io.params.metamorpheus.identify_file_type(file: str | IO) str[source]#

Identify whether a single MetaMorpheus file is the TOML settings file or the version text file.

Parameters:

file (Union[str, IO]) – Path string or file-like object to inspect.

Returns:

"toml" if the file parses as a TOML settings file, "version" otherwise.

Return type:

str

proteobench.io.params.metamorpheus.load_files(file1: str | IO, file2: str | IO) Tuple[str | None, dict | None][source]#

Load two files (IO objects or file paths), returning: - The first line from a plain text file as the version string - A dictionary parsed from a TOML file

Returns:

versions_line, settings_dict

Return type:

Tuple[Union[str, None], Union[dict, None]]

proteobench.io.params.metamorpheus.parse_modifications(mods: str) list[source]#

Parse modifications from a string or list format into a standardized list.

Parameters:

mods (Union[str]) – Modifications in string format (e.g., “”Common Fixed Carbamidomethyl on C Common Fixed Carbamidomethyl on U””)

Returns:

List of modifications.

Return type:

list