Skip to content

Comments

feat: add calibration report export functionality#161

Merged
singjc merged 3 commits intoPyProphet:masterfrom
singjc:feat/calibration_report
Sep 30, 2025
Merged

feat: add calibration report export functionality#161
singjc merged 3 commits intoPyProphet:masterfrom
singjc:feat/calibration_report

Conversation

@singjc
Copy link
Contributor

@singjc singjc commented Sep 30, 2025

This pull request adds a new CLI command for exporting OpenSwath calibration debug reports. The most important changes are grouped below:

pyprophet export calibration-report --help
PyProphet v3.0.0
Execution time: 2025-09-30 12:56:23
System: OS: Linux 6.9.3-76060903-generic | Python: 3.10.14 | CPU: 20 cores | RAM: 62.4 GB
Command: /home/singjc/anaconda3/envs/py310/bin/python /home/singjc/anaconda3/envs/py310/bin/pyprophet export calibration-report --help

Usage: pyprophet export calibration-report [OPTIONS]

  Generate a calibration report from OpenSwathWorkflow debug calibration files

Options:
  --wd DIRECTORY                        Working directory containing debugging
                                        files.  [default: .]
  --im-cal-pattern TEXT                 Ion mobility debug file pattern.
                                        [default: _debug_calibration_im.txt]
  --mz-cal-pattern TEXT                 m/z debug file pattern.  [default:
                                        _debug_calibration_mz.txt]
  --irt-trafo-pattern TEXT              iRT trafoXML pattern.  [default:
                                        _debug_calibration_irt.trafoXML]
  --irt-mzml-pattern TEXT               iRT XIC mzML pattern.  [default:
                                        _debug_calibration_irt_chrom.mzML]
  --report-file FILE                    Output PDF path.  [default:
                                        calibration_report.pdf]
  --zoom-in-xic / --no-zoom-in-xic      Zoom into XICs ±50 s around RT apex.
                                        [default: zoom-in-xic]
  --verbose INTEGER RANGE               Verbosity level 0/1/2.  [default: 0;
                                        0<=x<=2]
  --help                                Show this message and exit.
  --helphelp                            Show advanced help with all options

Example

$ pyprophet export calibration-report 
PyProphet v3.0.0
Execution time: 2025-09-30 12:56:41
System: OS: Linux 6.9.3-76060903-generic | Python: 3.10.14 | CPU: 20 cores | RAM: 62.4 GB
Command: /home/singjc/anaconda3/envs/py310/bin/python /home/singjc/anaconda3/envs/py310/bin/pyprophet export calibration-report

INFO: Found 3 unique runs to generate reports for
---------------------------------------------------------------------
INFO: Processing run - 20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A1_1_2737
INFO: IM calibration file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A1_1_2737_debug_calibration_im.txt
INFO: MZ calibration file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A1_1_2737_debug_calibration_mz.txt
INFO: iRT transformation file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A1_1_2737_debug_calibration_irt.trafoXML
INFO: iRT XIC mzML - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A1_1_2737_debug_calibration_irt_chrom.mzML
INFO: Zooming into XICs if possible...
---------------------------------------------------------------------
INFO: Processing run - 20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A2_1_2738
INFO: IM calibration file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A2_1_2738_debug_calibration_im.txt
INFO: MZ calibration file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A2_1_2738_debug_calibration_mz.txt
INFO: iRT transformation file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A2_1_2738_debug_calibration_irt.trafoXML
INFO: iRT XIC mzML - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A2_1_2738_debug_calibration_irt_chrom.mzML
INFO: Zooming into XICs if possible...
---------------------------------------------------------------------
INFO: Processing run - 20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A4_1_2740
INFO: IM calibration file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A4_1_2740_debug_calibration_im.txt
INFO: MZ calibration file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A4_1_2740_debug_calibration_mz.txt
INFO: iRT transformation file - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A4_1_2740_debug_calibration_irt.trafoXML
INFO: iRT XIC mzML - ./20200505_Evosep_200SPD_SG06-16_MLHeLa_200ng_py8_S3-A4_1_2740_debug_calibration_irt_chrom.mzML
INFO: Zooming into XICs if possible...
INFO: Done. Saved report to 'calibration_report.pdf'. Elapsed: 0 days 00:00:11.934842
[ 2025-09-30 at 12:56:53 | INFO    | util::543                   ] pyprophet export_calibration_report took 11.96 seconds; Peak Memory Usage: 433.62 MB.
image

New Feature: Calibration Report Export

  • Added a new calibration-report CLI command (export_calibration_report) to generate calibration reports from OpenSwathWorkflow debug calibration files, with multiple options for input patterns and output customization.
  • Imported the generate_calibration_report function from export.calibration_report to support the new command.
  • Registered the new calibration-report command in the main export CLI group.

Code Consistency and Minor Improvements

  • Updated multiple click.option definitions for consistent formatting by adding trailing commas, improving readability and maintainability.
  • Standardized function signatures and calls by adding trailing commas to argument lists, aligning with Python best practices. [1] [2]

Minor Code Cleanups

  • Added blank lines after function calls for better code separation and readability. [1] [2]

@singjc singjc merged commit fd45a5f into PyProphet:master Sep 30, 2025
1 check passed
@singjc singjc deleted the feat/calibration_report branch September 30, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant