Skip to content
Snippets Groups Projects
Commit afaf4c2f authored by Matthew Laird's avatar Matthew Laird
Browse files

Update Bio::EnsEMBL::Exon->is_coding():

- Update documentation on required parameters
- Throw an error if a Transcript isn't given
- Add a test for regression
parent c0d38d06
No related branches found
No related tags found
4 merge requests!281Update Bio::EnsEMBL::Exon->is_coding():,!342Feature/schema update 96,!342Feature/schema update 96,!281Update Bio::EnsEMBL::Exon->is_coding():
......@@ -1281,8 +1281,7 @@ sub is_constitutive {
=head2 is_coding
Arg [1] : Boolean $is_coding
Arg [2] : Bio::EnsEMBL::Transcript
Arg [1] : Bio::EnsEMBL::Transcript
Example : $exon->is_coding()
Description: Says if the exon is within the translation or not
Returntype : Int
......@@ -1295,6 +1294,8 @@ sub is_constitutive {
sub is_coding {
my ( $self, $transcript) = @_;
if (!$transcript) { throw("Transcript parameter is required for " . __PACKAGE__ . "->is_coding()."); }
if (!$transcript->translate) { return 0; }
# coding region overlaps start of exon
......
......@@ -76,6 +76,9 @@ ok(&test_getter_setter($exon, 'end_phase', 1));
ok( test_getter_setter( $exon, "created_date", time() ));
ok( test_getter_setter( $exon, "modified_date", time() ));
# Test that no parameter to is_coding() throws an exception
throws_ok { $exon->is_coding() } qr/parameter is required/, "Transcript parameter required for is_coding()";
#
# find supporting evidence for the exon
#
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment