proteobench.io.params.peaks module#

Peaks parameter parsing.

proteobench.io.params.peaks.clean_text(text: str) str[source]#

Clean the input text by removing leading and trailing spaces, colons, commas, or tabs.

Parameters:

text (str) – The text to be cleaned.

Returns:

The cleaned text.

Return type:

str

proteobench.io.params.peaks.extract_mass_tolerance(lines: List[str], search_term: str) str | None[source]#

Extract the mass tolerance value associated with a search term, with special handling for “System Default”.

Parameters:
  • lines (List[str]) – The list of lines to search through.

  • search_term (str) – The term to search for in the lines.

Returns:

The extracted mass tolerance value, or None if the search term is not found.

Return type:

Optional[str]

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

Read a PEAKS settings file, extract parameters, and return them as a ProteoBenchParameters object.

Parameters:

file_path (str) – The path to the PEAKS settings file.

Returns:

The extracted parameters encapsulated in a ProteoBenchParameters object.

Return type:

ProteoBenchParameters

proteobench.io.params.peaks.extract_value(lines: List[str], search_term: str) str | None[source]#

Extract the value associated with a search term from a list of lines.

Parameters:
  • lines (List[str]) – The list of lines to search through.

  • search_term (str) – The term to search for in the lines.

Returns:

The extracted value, or None if the search term is not found.

Return type:

Optional[str]

proteobench.io.params.peaks.extract_value_regex(lines: List[str], search_term: str) str | None[source]#

Extract the value associated with a search term using regular expressions.

Parameters:
  • lines (List[str]) – The list of lines to search through.

  • search_term (str) – The regular expression to search for in the lines.

Returns:

The extracted value, or None if the search term is not found.

Return type:

Optional[str]

proteobench.io.params.peaks.get_items_between(lines: list, start: str, end: str, only_last: bool = False) list[source]#

Find all lines starting with ‘-’ that appear between ‘start’ and ‘end’. Return them as a list of strings, without the leading dash.

Parameters:
  • lines (list) – The list of lines to search through.

  • start (str) – The start term to search for in the lines.

  • end (str) – The end term to search for in the lines.

  • only_last (bool) – If True, only the items found between the last occurrence of start and end will be returned.

Returns:

The list of items found between the start and end terms.

Return type:

list