Skip to content

Commit

Permalink
Write report by default; fix report path (double .ms2rescore)
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfG committed Sep 25, 2023
1 parent 1de19b3 commit 4832a91
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Others
data/*
nbs/
.prettierrc
data/
steps.txt
old_files/
prepare_pin_files.py
Expand Down
16 changes: 16 additions & 0 deletions examples/xtandem-ms2rescore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ms2rescore": {
"psm_file": "examples/data/search/xtandem/pyro.t.xml",
"psm_file_type": "xtandem",
"spectrum_path": "examples/data/spectra/Velos005137.mgf",
"psm_id_pattern": "(\\S+).*",
"modification_mapping": {
"+57.022": "U:Carbamidomethyl",
"+15.994": "U:Oxidation",
"+39.9954": "U:Pyro-carbamidomethyl",
"+42.0106": "U:Acetyl",
"-17.0266": "U:Gln->pyro-Glu",
"-18.0106": "U:Glu->pyro-Glu"
}
}
}
2 changes: 1 addition & 1 deletion ms2rescore/package_data/config_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"processes": -1,
"rename_to_usi": false,
"fasta_file": null,
"write_report": false
"write_report": true
}
}
4 changes: 1 addition & 3 deletions ms2rescore/report/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ def _get_overview_context(confidence_before, confidence_after) -> dict:


def _get_target_decoy_context(psm_list) -> dict:
# fasta_file = "../../examples/fasta/uniprot-proteome-human-contaminants.fasta"
# confidence_estimates = _get_confidence_estimates(psm_list, fasta_file)
logger.debug("Generating target-decoy charts...")
psm_df = psm_list.to_dataframe()
return {
Expand Down Expand Up @@ -363,7 +361,7 @@ def _get_log_context(files: Dict[str, Path]) -> dict:

def _render_and_write(output_path_prefix: str, **context):
"""Render template with context and write to HTML file."""
report_path = Path(output_path_prefix + ".ms2rescore.report.html").resolve()
report_path = Path(output_path_prefix + ".report.html").resolve()
logger.info("Writing report to %s", report_path.as_posix())
template_dir = Path(__file__).parent / "templates"
env = Environment(loader=FileSystemLoader(template_dir, encoding="utf-8"))
Expand Down

0 comments on commit 4832a91

Please sign in to comment.