Skip to content

[ENSCORESW-2465] Fix comparisons in Exon::is_coding() to prevent fals…

Marek Szuba requested to merge bugfix/ENSCORESW-2465 into master

Created by: ens-bwalts

…e-negatives when transcript and exon boundaries match exactly. Added additional transcript and translation structures to exon test cases.


  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion;
  • Review the contributing guidelines for this repository; remember in particular:
    • do not modify code without testing for regression
    • provide simple unit tests to test the changes
    • if you change the schema you must patch the test databases as well, see Updating the schema
    • the PR must not fail unit testing


Changes comparisons in Exon::is_coding() to use <= and >= so that they catch cases where coding region boundaries exactly match exon boundaries. Also added several new test cases to exon.t to check for correct behaviour when exon boundaries exactly match coding region boundaries in both single- and multi-exon transcripts.

Use case

When exon boundaries exactly match coding region boundaries, Exon::is_coding() was returning zero, even though the exons were coding (false negative).


Fixes a user-reported bug, and increases test coverage to identify if this (or a similar) bug reoccurs.

Possible Drawbacks



Yes, in exon.t

If so, do the tests pass/fail?

Pass. Checked that they fail with previous version of is_coding()

Have you run the entire test suite and no regression was detected?


Merge request reports