Skip to content

If a user tries to request a cds or protein type in the sequence endp…

Marek Szuba requested to merge bugfix/ENSCORESW2842 into master

Created by: lairdm

…oint using an exon id, that should be an error. We don't know what transcript to associate with that exon.

We don't need to create an entire top level elsif for Bio::EnsEMBL::Exon, that would cause duplication of the default behaviour code for all other 'type' arguments. If in the future the logic becomes more complex, then yes Exons can get their on entry in the Gene, Transcript, etc top level if/else statements. But this is a very specific corner case.

Requirements

  • 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
    • the PR must not fail unit testing
    • if you're adding/updating documentation of an endpoint, make sure you add/update the necessary parameters to the (template) configuration files in the ensembl-rest_private repo

Description

If a user tries to request a cds or protein type in the sequence endpoint using an exon id, that should be an error. We don't know what transcript to associate with that exon. So... throw an error.

Use case

A user does type=protein or type=cds on the sequence endpoint with an exon id, that's lunacy. Lunacy, I tell you!

Benefits

Users won't think they're getting exons with the UTR trimmed, when they're not.

Possible Drawbacks

Break legacy code that doesn't take it in to account.

Testing

Added tests for this situation, plus a successful exon retrieval test which never existed.

If so, do the tests pass/fail?

Pass

Changelog

[/sequence/id] Retrieving sequence using an exon id and types protein or cds now return an error, this combination of parameters is not valid.

Merge request reports