proteobench.io.params.diann module#
DIA-NN parameter parsing.
- proteobench.io.params.diann.extract_cfg_parameter(lines: ~typing.List[str], regex: str, cast_type: type = <class 'str'>, default=None, search_all=False) Any[source]#
Extract and cast a parameter using a regex pattern.
- proteobench.io.params.diann.extract_modifications(lines: List[str], regexes: List[str]) str | None[source]#
Extract and join modifications from a list of regexes.
- proteobench.io.params.diann.extract_params(fname: str, json_file='/home/docs/checkouts/readthedocs.org/user_builds/proteobench/envs/0.15.3/lib/python3.11/site-packages/proteobench/io/params/json/Quant/quant_lfq_DIA_ion.json') ProteoBenchParameters[source]#
Parse DIA-NN log file and extract relevant parameters.
Logic: 1. Read the log file and extract the software version. 2. Find the command line string that was used to run DIA-NN. 3. Parse the command line string to extract settings. Default values are set for parameters that are not specified in the command line. 4. If the –cfg flag is used (meaning a configuration file was used),
the parameters are parsed from the free text underneath the cmd line.
- Parameters:
fname (str) – Parameter file name path.
- Returns:
The parsed ProteoBenchParameters object.
- Return type:
- proteobench.io.params.diann.extract_with_regex(lines: List[str], regex, search_all=False) str[source]#
If no mass accuracy was specified in the cmd string, extract it from the log-file.
- proteobench.io.params.diann.find_cmdline_string(lines: List[str]) str | None[source]#
Find the command line statement in the log file of DIANN.
It is assumed that this statement is stored on a single line.
- proteobench.io.params.diann.parse_cmdline_string(cmd_line: str, software_version: str) dict[source]#
Parse a DIA-NN command line string into a dictionary of settings.
- Parameters:
- Returns:
Parsed settings in dictionary format. Keys are setting names, and values are: - List of inputs for multi-value settings. - Boolean True for flag-like settings (without values). - Modified settings for variable and fixed modifications.
- Return type:
- Raises:
AssertionError – If an unsupported setting format is detected (e.g., unimod with extra arguments).
- proteobench.io.params.diann.parse_predictors_library(cmdline_dict: dict)[source]#
Parse the spectral library predictors from parsed execute command string.
For now, only ‘DIANN’ and ‘User defined speclib’ are supported. In the future, the user might specify which algorithm was used for library generation.
- proteobench.io.params.diann.parse_protein_inference_method(cmdline_dict: dict) str[source]#
Parse the protein inference method from the parsed execution command string.
This setting is defined by disparate setting tags, namely: - no-prot-inf: No protein inference - pg-level: Code specifies inference method
- proteobench.io.params.diann.parse_quantification_strategy(cmdline_dict: dict)[source]#
Parse the quantification method from the parsed execution command string.
This setting is defined by disparate setting tags, namely: - direct-quant: use legacy quantification within DIANN - high-acc: QuantUMS high-accuracy setting - no tag: Default is QuantUMS high-precision