Created by: tgrego
- 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
This PR deprecates the SequenceOntologyMapper, providing the missing alternative ways to have all the functionality it provides.
To get the SO acc of a feature:
To get the SO acc of a gene/transcript biotype:
To get the SO name of a SO acc:
$oa = Bio::EnsEMBL::Registry->get_adaptor('multi','ontology','OntologyTerm');
$so_name = $oa->fetch_by_accession($so_acc)->name;
If you want biotype SOs and fallback to feature SOs, implement that logic in your code.
SequenceOntologyMapper provides a way to access SO terms for biotypes and feature types, through a series of lookup tables. The Gene and Transcript biotype SO terms could already be accessed alternatively using the Biotype object that can be accessed by the get_Biotype method on gene and transcript objects. Feature type SO terms were missing and are now implemented, through the new method feature_so_acc that is inherited and can be overridden by features.
Removing the SequenceOntologyMapper
Although a 'feature' thing, Slice implements feature_so_acc. Slice is however not a feature, but will return either the SO of its coordinate system if available or of a generic region.
Bio::EnsEMBL::Compara::ConstrainedElement was included in the SequenceOntologyMapper. It is however not a feature, and thus will need implementation of feature_so_acc. Attention, this is in ensembl-compara.
GFFSerializer in this repo used the SequenceOntologyMapper and was updated to use the alternative ways, removing the SequenceOntologyMapper requirement. Other modules in ensembl-production and ensembl-io (and maybe more?) make use of SequenceOntologyMapper and require similar updates.
Have you added/modified unit tests to test the changes?
If so, do the tests pass/fail?
Pass, of course.
Have you run the entire test suite and no regression was detected?