diff --git a/modules/Bio/EnsEMBL/Slice.pm b/modules/Bio/EnsEMBL/Slice.pm index 23f17de877e106c9ce6bd7ae6b76bdd26cf0652d..ec723222995472f8c0d479fc323f0e6f891cf832 100644 --- a/modules/Bio/EnsEMBL/Slice.pm +++ b/modules/Bio/EnsEMBL/Slice.pm @@ -76,6 +76,8 @@ use Bio::EnsEMBL::StrainSlice; use Bio::EnsEMBL::Mapper::RangeRegistry; use Bio::EnsEMBL::SeqRegionSynonym; +use Bio::EnsEMBL::Variation::Utils::Constants qw(%VARIATION_CLASSES); + # use Data::Dumper; my $reg = "Bio::EnsEMBL::Registry"; @@ -1807,9 +1809,19 @@ sub get_all_StructuralVariations{ # Get the attrib_id my $at_adaptor = $variation_db->get_AttributeAdaptor; - my $SO_term = $at_adaptor->SO_term_for_SO_accession($sv_class); + + # Find the SO term associated with the SO accession number ($sv_class) + my $SO_term = ''; + foreach my $term (%VARIATION_CLASSES) { + if ($VARIATION_CLASSES{$term}->{'SO_accession'} eq $sv_class) { + $SO_term = $term; + last; + } + } + + # Attrib ID of the SO term my $attrib_id = $at_adaptor->attrib_id_for_type_value('SO_term',$SO_term); - + if (!$attrib_id) { warning("The Sequence Ontology accession number is not found in the database"); return [];