Skip to content

Commit 95e149e

Browse files
minor changes to logging and other bugfixes
1 parent 496c0b8 commit 95e149e

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

ms2rescore/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def rescore(configuration: Dict, psm_list: Optional[PSMList] = None) -> None:
3737
f"Running MS²Rescore with following configuration: {json.dumps(configuration, indent=4)}"
3838
)
3939
config = configuration["ms2rescore"]
40-
output_file_root = config["output_path"]
40+
output_file_root = config["output_path"].split(".intermidiate.")[
41+
0
42+
] # if no intermediate, takes full name
4143

4244
# Write full configuration including defaults to file
4345
with open(output_file_root + ".full-config.json", "w") as f:

ms2rescore/parse_psms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def parse_psms(config: Dict, psm_list: Union[PSMList, None]) -> PSMList:
8484
{
8585
"before_rescoring_score": psm.score,
8686
"before_rescoring_qvalue": psm.qvalue,
87-
"before_rescoring_pep": psm.pep if psm.pep is not None else float("nan"),
87+
"before_rescoring_pep": psm.pep
88+
if psm.pep is not None
89+
else float("nan"), # until fixed in psm_utils
8890
"before_rescoring_rank": psm.rank,
8991
}
9092
)

ms2rescore/parse_spectra.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ def add_precursor_values(
8484
if np.any(np.isnan(mz_values)) or np.all(mz_values == 0):
8585
missing_data_types.add(MSDataType.precursor_mz)
8686

87-
LOGGER.debug("Missing data types: %s", missing_data_types)
88-
8987
# Find data types that are both missing and required
9088
data_types_to_parse = missing_data_types & required_data_types
9189

@@ -103,6 +101,11 @@ def add_precursor_values(
103101
"Spectrum path must be provided to parse precursor values that are not present in the"
104102
" PSM list."
105103
)
104+
else:
105+
LOGGER.debug(
106+
"Missing required data types: %s. Parsing from spectrum files.",
107+
", ".join(str(dt) for dt in data_types_to_parse),
108+
)
106109

107110
# Get precursor values from spectrum files
108111
LOGGER.info("Parsing precursor info from spectrum files...")

0 commit comments

Comments
 (0)