Skip to content

Fix #127: TypeError when mapping_quality is None#141

Merged
iskandr merged 2 commits into
masterfrom
fix-127-mapq-none-typeerror-v2
Apr 16, 2026
Merged

Fix #127: TypeError when mapping_quality is None#141
iskandr merged 2 commits into
masterfrom
fix-127-mapq-none-typeerror-v2

Conversation

@iskandr

@iskandr iskandr commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Guard on mapping_quality is None first, before any numeric comparison.
  • When min_mapping_quality == 0, treat None MAPQ as 0 instead of crashing.
  • Two tests with mock pysam reads: None MAPQ accepted at threshold=0, skipped at threshold=1.
  • Bumped version to 1.4.5.

Fixes #127

Test plan

  • ./test.sh passes (154 tests)
  • ./lint.sh passes

Guard on mapping_quality is None first, regardless of min_mapping_quality.
When min_mapping_quality > 0, reads with None MAPQ are skipped (as before).
When min_mapping_quality == 0, None MAPQ is treated as 0 so the comparison
does not raise TypeError.

Fixes #127
@coveralls

coveralls commented Apr 16, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.067% (+0.1%) from 92.969% — fix-127-mapq-none-typeerror-v2 into master

@iskandr iskandr merged commit f9694f5 into master Apr 16, 2026
4 of 6 checks passed
@iskandr iskandr deleted the fix-127-mapq-none-typeerror-v2 branch April 16, 2026 01:59
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.

Bug: TypeError when a read's mapping_quality is None and min_mapping_quality == 0

2 participants