auto_process_ngs.bcl2fastq.reporting
Provides classes and functions for reporting QC information
about Fastq generation, based on data in files produced by the
fastq_statistics.py
utility.
The main class ProcessingQCReport
takes these statistics
files as input and composes an HTML report.
The detect_processing_qc_warnings
function scans an HTML
report from ProcessingQCReport
and indicates whether the
report contains any warnings.
- class auto_process_ngs.bcl2fastq.reporting.ProcessingQCReport(analysis_dir, stats_file, per_lane_stats_file, per_lane_sample_stats_file, name=None)
Create a processing QC report document
Example usage:
>>> report = ProcessingQCReport(...) >>> report.write("processing_qc_report.html")
- add_per_fastq_statistics()
Add a section with the per-Fastq statistics
- add_per_lane_sample_statistics()
Add a section with the per-lane sample statistics
- add_per_lane_statistics()
Add a section with the per-lane statistics
- add_to_toc(title, s, sub_toc=None)
Add an item to the table of contents
- Parameters:
title (str) – title for the item in the table of contents
s (Object) – document item to target in the table of contents
sub_toc (List) – optional, sub table of contents to append for this item
- finalise_warnings()
Sets up warning indications on report
This method should be called when the report content has been assembled; it performs the final actions for displaying the general warning indicator etc.
- flag_warnings()
Set flag to indicate that report includes warnings
By default the flag is set to
False
(i.e. no warnings in the report); calling this method one or more time sets the flag toTrue
(i.e. at least one warning in the report).The flag is checked by the
finalise_warnings
method when the report is completed.
- init_toc(title='Contents')
Initialise the table of contents
- Parameters:
title (str) – title for the table of contents (default: “Contents”)
- init_warnings()
Initialise section to indicate report has warnings
The ‘warnings’ section is hidden by default, but a call to the ‘flag_warnings’ method will cause it to be unhidden when the HTML report is generated
- warning(message, size=None)
Return object for displaying a warning
Returns an object which will render to an HTML warning message (essentially a paragraph with a warning icon and the supplied message text).
- Parameters:
message (str) – warning message to display
size (int) – optional, set the size for the warning icon
- auto_process_ngs.bcl2fastq.reporting.detect_processing_qc_warnings(html_file)
Look for warning text in processing_qc.html file
- Parameters:
html_file (str) – path to HTML report file
- Returns:
True if warnings were found, False if not.
- Return type:
Boolean