[ensembl-dev] Question about AligSlice and get_all_Slices method

Marc P. Hoeppner mphoeppner at gmail.com
Fri Sep 11 07:52:15 BST 2015


Dear EnsEMBL developers,

I've just played around with a script I wrote ages ago and found it does 
not work anymore. Briefly, I am retrieving a human gene, converting it 
to a slice and am then trying to use the AlignSlice to check which other 
genomes have alignments to this feature. However, this query never 
completes and seems stuck on

my $sub_slices = $align_slice->get_all_Slices;

Tried it against the EnsEMBL mirror as well as a mix of remote and local 
DBs as well as different MethodLinkSpeciesSets for releases 79 and 81. 
Has anything changed about the behaviour of this class?


Cheers,

Marc

PS: For reference, the relevant code:

my $gene_adaptor = $registry->get_adaptor("human", "Core", "Gene");
my $genes = $gene_adaptor->fetch_all_by_external_name($rfam_acc,'RFAM');
throw("No genes found for this rfam accession") if (!$genes);

# Getting Bio::EnsEMBL::Compara::MethodLinkSpeciesSet object
my $mlssa = $registry->get_adaptor("Multi", "compara", 
"MethodLinkSpeciesSet");
my $method_link_species_set = 
$mlssa->fetch_by_method_link_type_species_set_name($alignment_type,$set_of_species);
throw("MLSS not found") if (!$method_link_species_set);

my $align_slice_adaptor = Bio::EnsEMBL::Registry->get_adaptor( "Multi" 
,"Compara","AlignSlice");

throw("Failed to retrieve AlignSlice Adaptor") if (!$align_slice_adaptor);

foreach my $gene (@$genes) {

     print $gene->stable_id , "\n";
     my $slice = $gene->slice;

     my $align_slice = 
$align_slice_adaptor->fetch_by_Slice_MethodLinkSpeciesSet(
               $slice,
               $method_link_species_set,
               "expanded"
           );

     throw("No AlignSlice for this region found") if (!$align_slice) ;

     my $sub_slices = $align_slice->get_all_Slices;
     foreach my $slice (@$sub_slices) {
         print $slice->genome_db->name , "\n";
     }
}





More information about the Dev mailing list