Skip to content
Snippets Groups Projects
Commit 35c77d47 authored by Daniel Rios's avatar Daniel Rios
Browse files

modified modules using StrainSlice to handle new database schema

parent a4b8b7ed
No related branches found
No related tags found
No related merge requests found
......@@ -109,14 +109,14 @@ sub new{
my $af_adaptor = $variation_db->get_AlleleFeatureAdaptor;
if( $af_adaptor ) {
#get the Population for the given strain
my $pop_adaptor = $variation_db->get_PopulationAdaptor;
if ($pop_adaptor){
my $population = $pop_adaptor->fetch_by_name($self->{'strain_name'});
#check that the population returned is a strain
if ((defined $population) && ($population->is_strain)){
my $allele_features = $af_adaptor->fetch_all_by_Slice_Population($self,$population);
#get the Individual for the given strain
my $ind_adaptor = $variation_db->get_IndividualAdaptor;
if ($ind_adaptor){
my $individual = shift @{$ind_adaptor->fetch_all_by_name($self->{'strain_name'})}; #the name should be unique for a strain
#check that the individua returned isin the database
if (defined $individual){
my $allele_features = $af_adaptor->fetch_all_by_Slice($self,$individual);
$self->{'alleleFeatures'} = $allele_features;
return $self;
}
......@@ -126,7 +126,7 @@ sub new{
}
}
else{
warning("Not possible to retrieve PopulationAdaptor from the variation database");
warning("Not possible to retrieve IndividualAdaptor from the variation database");
return '';
}
} else {
......
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