Skip to content

Commit

Permalink
Merge branch 'main' into 505-dia-nn-params-modification-parsing-goes-…
Browse files Browse the repository at this point in the history
…wrong-in-older-versions
  • Loading branch information
rodvrees authored Dec 16, 2024
2 parents 9ef6885 + cc5bfa0 commit 3ef4487
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions proteobench/io/params/alphadia.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,14 @@ def extract_params(fname: str) -> ProteoBenchParameters:
Returns:
ProteoBenchParameters: An object containing the extracted parameters.
"""
with open(fname) as f:
lines_read = f.readlines()
lines = [line for line in lines_read if "──" in line]

version = extract_file_version(lines_read[6])
try:
with open(fname) as f:
lines_read = f.readlines()
lines = [line for line in lines_read if "──" in line]
version = extract_file_version(lines_read[6])
except:
lines = [l for l in fname.read().decode("utf-8").splitlines() if "──" in l]
version = extract_file_version(lines[6])

line_generator = iter(lines)
first_line = next(line_generator)
Expand Down
2 changes: 1 addition & 1 deletion proteobench/io/params/maxquant.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def extract_params(fname, ms2frac="FTMS") -> ProteoBenchParameters:
params.ident_fdr_psm = None
params.ident_fdr_peptide = float(record.loc["peptideFdr"].squeeze())
params.ident_fdr_protein = float(record.loc["proteinFdr"].squeeze())
params.enable_match_between_runs = record.loc["matchBetweenRuns"].squeeze() == "True"
params.enable_match_between_runs = record.loc["matchBetweenRuns"].squeeze().lower() == "true"
_precursor_mass_tolerance = record.loc[
pd.IndexSlice["parameterGroups", "parameterGroup", "mainSearchTol", :]
].squeeze()
Expand Down
2 changes: 1 addition & 1 deletion test/params/mqpar1.5.3.30_MBR_sel.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ident_fdr_psm": null,
"ident_fdr_peptide": 0.01,
"ident_fdr_protein": 0.01,
"enable_match_between_runs": false,
"enable_match_between_runs": true,
"precursor_mass_tolerance": "[-4.5 ppm, 4.5 ppm]",
"fragment_mass_tolerance": "[-20 ppm, 20 ppm]",
"enzyme": "Trypsin/P",
Expand Down

0 comments on commit 3ef4487

Please sign in to comment.