Skip to content

Commit

Permalink
Use the funcgen PERL API to retrieve the sample reg. feature instead …
Browse files Browse the repository at this point in the history
…of the INI file (#1035)
  • Loading branch information
pblins authored Oct 29, 2024
1 parent b3d6471 commit 12bc365
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions modules/EnsEMBL/Web/Component/Info/HomePage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package EnsEMBL::Web::Component::Info::HomePage;

use strict;

use Bio::EnsEMBL::Registry;
use EnsEMBL::Web::Document::HTML::HomeSearch;
use EnsEMBL::Web::Utils::FormatText;

Expand Down Expand Up @@ -352,13 +353,17 @@ sub funcgen_text {
my $hub = $self->hub;
return unless $hub->database('funcgen');

my $species_defs = $hub->species_defs;
my $sample_data = $species_defs->SAMPLE_DATA;

if ($sample_data->{'REGULATION_PARAM'}) {
my $species = $hub->species;
my $species = $hub->species;
my $reg_build_adaptor = Bio::EnsEMBL::Registry->get_adaptor($species, 'Funcgen', 'RegulatoryBuild');
my $current_reg_build = $reg_build_adaptor->fetch_current_regulatory_build();

if ($current_reg_build) {

my $species_defs = $hub->species_defs;
my $species_prod_name = $species_defs->get_config($species, 'SPECIES_PRODUCTION_NAME');
my $ftp = $self->ftp_url;

my $sample_reg_feature = $current_reg_build->get_sample_RegulatoryFeature();

return sprintf('
<div class="homepage-icon">
Expand All @@ -372,8 +377,8 @@ sub funcgen_text {

sprintf(
$self->{'img_link'},
$hub->url({ type => 'Regulation', action => 'Summary', db => 'funcgen', rf => $sample_data->{'REGULATION_PARAM'}, __clear => 1 }),
"Go to regulatory feature $sample_data->{'REGULATION_TEXT'}", 'regulation', 'Example regulatory feature'
$hub->url({ type => 'Regulation', action => 'Summary', db => 'funcgen', rf => $sample_reg_feature->{'stable_id'}, __clear => 1 }),
"Go to regulatory feature $sample_reg_feature->{'stable_id'}", 'regulation', 'Example regulatory feature'
),

sprintf($self->{'icon'}, 'info'), $species_defs->ENSEMBL_SITETYPE,
Expand Down

0 comments on commit 12bc365

Please sign in to comment.