proteobench.io.params.fragger module#

Functionality to parse FragPipe fragger.params parameter files.

FragPipe has a text based parameter file format which separates parameters and their value using an equal sign. Optional comments are expressed with a hash sign.

class proteobench.io.params.fragger.Parameter(name, value, comment)#

Bases: tuple

comment#

Alias for field number 2

name#

Alias for field number 0

value#

Alias for field number 1

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

Parse FragPipe parameter files and extract relevant parameters into a ProteoBenchParameters object.

Parameters:

file (BytesIO) – The FragPipe parameter file to parse.

Returns:

The extracted parameters encapsulated in a ProteoBenchParameters object.

Return type:

ProteoBenchParameters

proteobench.io.params.fragger.parse_params(l_of_str: List[str], sep: str = ' = ') List[Parameter][source]#

Parse the FragPipe parameter file and return a list of Parameter objects.

Parameters:
  • l_of_str (List[str]) – The lines of the FragPipe parameter file as a list of strings.

  • sep (str, optional) – The separator between parameter names and values. Default is “ = “.

Returns:

A list of Parameter namedtuples containing the parameter name, value, and any comment.

Return type:

List[Parameter]

proteobench.io.params.fragger.parse_phi_report_filters(phi_report_cmd: str) tuple[float, float, float][source]#

Parse the filters from the phi-report command string.

Parameters:

phi_report_cmd (str) – The command string from the phi-report filter.

Returns:

A tuple containing the PSM, peptide, and protein FDR values.

Return type:

tuple of (float, float, float)

proteobench.io.params.fragger.read_fragpipe_workflow(file: BytesIO, sep: str = '=') tuple[str, str | None, list[Parameter]][source]#

Read the FragPipe workflow file and return the header and a list of Parameter objects.

Parameters:
  • file (BytesIO) – The FragPipe workflow file to read.

  • sep (str, optional) – The separator used between parameter names and values. Default is “=”.

Returns:

A tuple containing the header and a list of Parameter objects.

Return type:

tuple of (str, list of Parameter)