diff --git a/modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm b/modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm index 9f2f628a59c0607ea7fd0f3b644d15c9a764efc8..8434ae6f1beda57527c98d820ad9223de9986083 100644 --- a/modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm +++ b/modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm @@ -172,10 +172,19 @@ sub calculate_same_codon{ sub type_variation { my $tr = shift; my $var = shift; + + my $UPSTREAM = 5000; + my $DOWNSTREAM = 5000; + if (!$var->isa('Bio::EnsEMBL::Variation::ConsequenceType')){ throw("Not possible to calculate the consequence type for ",ref($var)," : Bio::EnsEMBL::Variation::ConsequenceType object expected"); } + if (($var->start < $tr->start - $UPSTREAM) || ($var->end > $tr->end + $DOWNSTREAM)){ + #since the variation is more than UPSTREAM and DOWNSTREAM of the transcript, there is no effect in the transcript + return []; + } + my $tm = $tr->get_TranscriptMapper(); my @coords = $tm->genomic2cdna($var->start, $var->end,