Skip to content

Bug fix: failing on empty read count columns - #28

Merged
brendanreardon merged 8 commits into
mainfrom
bug-empty-read-counts
Nov 22, 2024
Merged

brendanreardon merged 8 commits into
mainfrom
bug-empty-read-counts

Conversation

@brendanreardon

@brendanreardon brendanreardon commented Nov 20, 2024 •

Copy link
Copy Markdown
Collaborator

A bug was introduced in pull request 18 when the handling of read count columns, due to Python 3.12 and pandas change to down casting of data types. Specifically, empty read count values would cause the function calculate_coverage to fail. The interpreter version was updated to 0.7.3 for this pull request and release.

Additions:

  • The functions convert_to_pandas_int64 and safe_cast were written within the CoverageMetrics class of moalmanac/features.py to safely manage non-integer values being provided for the columns t_alt_count and t_ref_count.
  • Additional unit tests were written for the features.CoverageMetrics class
  • A new function format_metadata_dictionary was added to moalmanac/moalmanac.py to ensure that missing data in the metadata dictionary is formatted correctly if the main function is instantiated directly.

Revisions:

  • Annotating with ExAC, ExACExtended, and ClinVar will now skip rows that have missing data in any of the required columns.

Bug fixes:

  • Coverage can now be calculated if some rows of the t_alt_count and t_ref_count columns are null.

Pre-pull request check list,

  • Relevant documentation has been updated
  • All unit tests pass
  • All outputs pre- and post- changes match by md5 hash
  • All files changed have been reviewed
  • Docker pushed

@brendanreardon

Copy link
Copy Markdown
Collaborator Author

All unit tests pass. All output regression tests pass for output files pre- and post- changes with both full example inputs and empty inputs, with the toggle-able settings both on and off.

2024-11-19-outputs-pre-change.zip
2024-11-20-outputs-post-change.zip

@brendanreardon

Copy link
Copy Markdown
Collaborator Author

No documentation needs to be updated for this change.

@brendanreardon

Copy link
Copy Markdown
Collaborator Author

All files changed have been reviewed.

@brendanreardon

Copy link
Copy Markdown
Collaborator Author

Docker pushed to tags latest and 0.7.3_v.2024-10-03.

@brendanreardon

Copy link
Copy Markdown
Collaborator Author

Further revising this branch to include

  • revisions that will skip annotation with ClinVar and ExAC for rows with missing data within necessary columns
  • reducing the default minimum contribution from mutational signatures, coverage for sequence variants, and spanning fragments for fusions to all be 0

@brendanreardon

Copy link
Copy Markdown
Collaborator Author

All unit tests match and regression outputs match with these changes to the ExAC and ClinVar annotation. The exception is that the example outputs do not match for ClinVar and ExAC outputs for fusions and copy number alterations, but they should not have been annotated with these data sources anyway and were previously preallocated with 0 values.

2024-11-21-outputs-post-change.zip

@brendanreardon
brendanreardon merged commit a4f7042 into main Nov 22, 2024
@brendanreardon
brendanreardon deleted the bug-empty-read-counts branch November 22, 2024 15:55
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