Refactor code in SliceAdaptor::fetch_by_region
Created by: nwillhoft
Description
There is code in SliceAdaptor::fetch_by_region() that has been marked for refactoring, specifically the code dealing with synonym/wildcard/fuzzy-matching. During work on creating a chromosome alias feature, I worked on refactoring this code into two new subroutines. This has led to splitting the original task into two (1. chromosome alias feature, and 2. refactoring code). See JIRA tickets ENSCORESW-3021 and ENSCORESW-3562.
Use case
This refactored code will be used by any SliceAdaptor::fetch_by_region
request where the seq_region_name
user argument is not an exact match to a seq_region_name
attribute in the relevant core database.
I understand that this code is used extensively by Ensembl users and therefore a note here to say that these changes will of course be extensively tested. (Use cases to be added here during this work.)
Benefits
In brief, the removal of superfluous code and making the code more readable.
During work on the chromosome alias feature, it became clear that the synonym/wildcard/fuzzy-match code needed to be refactored into subroutines to avoid large chunks of duplicate code being used in SliceAdaptor::fetch_by_region.
Possible Drawbacks
Testing
Have you added/modified unit tests to test the changes?
Not yet added any.
If so, do the tests pass/fail?
Have you run the entire test suite and no regression was detected?
Not yet run.