Skip to content

Conversation

@Ulthran
Copy link
Contributor

@Ulthran Ulthran commented Dec 2, 2025

Summary

  • allow the fastqc report script to write an empty report when no per-base sequence quality data is available

Testing

  • black .
  • pytest tests/unit/
  • pytest tests/e2e/test_sunbeam_run.py::test_sunbeam_run_with_single_end_reads (fails: conda not installed)

Codex Task

Copilot AI review requested due to automatic review settings December 2, 2025 20:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds graceful handling for empty FastQC reports when no per-base sequence quality data is available. Instead of failing when attempting to concatenate an empty list, the script now writes an empty report with appropriate logging.

Key Changes

  • Added a check for empty quality_list after filtering out None values
  • When no quality data is found, the script logs a message and writes an empty DataFrame to the output file
  • Early return prevents pandas.concat from attempting to process an empty list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +17
if len(quality_list) == 0:
log.write("No per-base sequence quality data found; writing empty report.\n")
pandas.DataFrame().to_csv(output_report, sep="\t", index_label="Samples")
return
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new empty report handling logic lacks test coverage. Consider adding unit tests to verify:

  1. The behavior when all input reports return None from parse_fastqc_quality (empty quality_list)
  2. That an empty DataFrame is correctly written to the output file
  3. That the appropriate log message is written

Similar workflow scripts like preprocess_report.py have comprehensive unit tests in tests/unit/test_preprocess_report.py. Consider adding a tests/unit/test_fastqc_report.py file with tests for this new functionality.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants