<commit_before>package EnsEMBL::Web::Component::Variation::Explore;

use strict;

use base qw(EnsEMBL::Web::Component::Variation);

sub _init {
  my $self = shift;
  $self->cacheable(0);
  $self->ajaxable(0);
}

sub content {
  my $self               = shift;
  my $hub                = $self->hub;
  my $object             = $self->object;
  my $variation          = $object->Obj;

  my $avail     = $self->object->availability;

  my ($seq_url, $gt_url, $pop_url, $geno_url, $context_url, $ld_url, $pheno_url, $phylo_url);
  $seq_url        = $hub->url({'action' => 'Sequence'});
  $context_url    = $hub->url({'action' => 'Context'});
  if ($avail->{'has_transcripts'}) {
    $gt_url   = $hub->url({'action' => 'Mappings'});
  }
  if ($avail->{'has_populations'}) {
    if ($avail->{'not_somatic'}) {
      $pop_url   = $hub->url({'action' => 'Population'});
    }
    elsif ($avail->{'is_somatic'}) {
      $pop_url  = $hub->url({'action' => 'Populations'});
    }
  }

  if ($avail->{'has_individuals'} && $avail->{'not_somatic'}) {
    $geno_url   = $hub->url({'action' => 'Individual'});
    if ($avail->{'has_ldpops'}) {
      $ld_url    = $hub->url({'action' => 'HighLD'});
    }
  }
  if ($avail->{'has_ega'}) {
    $pheno_url    = $hub->url({'action' => 'Phenotype'});
  }
  if ($avail->{'has_alignments'}) {
    $phylo_url    = $hub->url({'action' => 'Compara_Alignments'});
  }
  
  my ($p_title, $p_img);
  if($avail->{'not_somatic'}) {
    ($p_title, $p_img) = ('Population genetics', 'population_genetics');
  }
  else {
    ($p_title, $p_img) = ('Sample information', 'sample_information');
  }

  my @buttons = (
    {'title' => 'Genomic context',        'img' => 'genomic_context',        'url' => $context_url},
    {'title' => 'Gene/Transcript',        'img' => 'gene_transcript',        'url' => $gt_url},
    {'title' => $p_title,                 'img' => $p_img,                   'url' => $pop_url},
    {'title' => 'Individual genotypes',   'img' => 'individual_genotypes',   'url' => $geno_url},
    {'title' => 'Linkage disequilibrium', 'img' => 'linkage_disequilibrium', 'url' => $ld_url},
    {'title' => 'Phenotype data',         'img' => 'phenotype_data',         'url' => $pheno_url},
    {'title' => 'Phylogenetic context',   'img' => 'phylogenetic_context',   'url' => $phylo_url},
    {'title' => 'Sequence',               'img' => 'flanking_sequence',      'url' => $seq_url},
  );

  my $html;
  my $break = int(scalar(@buttons)/2);
  my $i = 0;
  my $size = 110;

  foreach my $button (@buttons) {
    if (($i % $break) == 0) {
      $html .= qq(
        <div class="centered">
      );
    } 
    my $title = $button->{'title'};
    my $img   = 'var_'.$button->{'img'};
    my $url   = $button->{'url'};
    if ($url) {
      $img .= '.png';
      $html .=
        '<a href="'.$url.'" title="'.$title.'">'.
          '<img src="/img/'.$img.'" class="portal" style="padding: 5px; width:'.$size.'px;height:'.$size.'px;" alt="'.$title.'" />'.
        '</a>';
    }
    else {
      $img   .= '.png';
      $title .= ' (NOT AVAILABLE)';
      $html .= '<img src="/img/'.$img.'" class="portal" style="opacity:0.3; filter:alpha(opacity=30); zoom:1; padding: 5px; width:'.$size.'px; height:'.$size.'px;" alt="" title="'.$title.'" />';
    }
    $i++;
    if ($i > 0 && ($i % $break) == 0) {<commit_msg>Removed inline styles from images - now in main stylesheet<commit_after>package EnsEMBL::Web::Component::Variation::Explore;

use strict;

use base qw(EnsEMBL::Web::Component::Variation);

sub _init {
  my $self = shift;
  $self->cacheable(0);
  $self->ajaxable(0);
}

sub content {
  my $self               = shift;
  my $hub                = $self->hub;
  my $object             = $self->object;
  my $variation          = $object->Obj;

  my $avail     = $self->object->availability;

  my ($seq_url, $gt_url, $pop_url, $geno_url, $context_url, $ld_url, $pheno_url, $phylo_url);
  $seq_url        = $hub->url({'action' => 'Sequence'});
  $context_url    = $hub->url({'action' => 'Context'});
  if ($avail->{'has_transcripts'}) {
    $gt_url   = $hub->url({'action' => 'Mappings'});
  }
  if ($avail->{'has_populations'}) {
    if ($avail->{'not_somatic'}) {
      $pop_url   = $hub->url({'action' => 'Population'});
    }
    elsif ($avail->{'is_somatic'}) {
      $pop_url  = $hub->url({'action' => 'Populations'});
    }
  }

  if ($avail->{'has_individuals'} && $avail->{'not_somatic'}) {
    $geno_url   = $hub->url({'action' => 'Individual'});
    if ($avail->{'has_ldpops'}) {
      $ld_url    = $hub->url({'action' => 'HighLD'});
    }
  }
  if ($avail->{'has_ega'}) {
    $pheno_url    = $hub->url({'action' => 'Phenotype'});
  }
  if ($avail->{'has_alignments'}) {
    $phylo_url    = $hub->url({'action' => 'Compara_Alignments'});
  }
  
  my ($p_title, $p_img);
  if($avail->{'not_somatic'}) {
    ($p_title, $p_img) = ('Population genetics', 'population_genetics');
  }
  else {
    ($p_title, $p_img) = ('Sample information', 'sample_information');
  }

  my @buttons = (
    {'title' => 'Genomic context',        'img' => 'genomic_context',        'url' => $context_url},
    {'title' => 'Gene/Transcript',        'img' => 'gene_transcript',        'url' => $gt_url},
    {'title' => $p_title,                 'img' => $p_img,                   'url' => $pop_url},
    {'title' => 'Individual genotypes',   'img' => 'individual_genotypes',   'url' => $geno_url},
    {'title' => 'Linkage disequilibrium', 'img' => 'linkage_disequilibrium', 'url' => $ld_url},
    {'title' => 'Phenotype data',         'img' => 'phenotype_data',         'url' => $pheno_url},
    {'title' => 'Phylogenetic context',   'img' => 'phylogenetic_context',   'url' => $phylo_url},
    {'title' => 'Sequence',               'img' => 'flanking_sequence',      'url' => $seq_url},
  );

  my $html;
  my $break = int(scalar(@buttons)/2);
  my $i = 0;

  foreach my $button (@buttons) {
    if (($i % $break) == 0) {
      $html .= qq(
        <div class="centered">
      );
    } 
    my $title = $button->{'title'};
    my $img   = 'var_'.$button->{'img'};
    my $url   = $button->{'url'};
    if ($url) {
      $img .= '.png';
      $html .=
        '<a href="'.$url.'">'.
          '<img src="/i/96/'.$img.'" class="portal" alt="'.$title.'" title"'.$title.'" />'.
        '</a>';
    }
    else {
      $img   .= '_off.png';
      $title .= ' (NOT AVAILABLE)';
      $html .= '<img src="/i/96/'.$img.'" class="portal" alt="'.$title.'" title="'.$title.'" />';
    }
    $i++;
    if ($i > 0 && ($i % $break) == 0) {
{'fraction_non_alphanumeric': 0.24297066014669927, 'fraction_numerical': 0.004278728606356968, 'mean_word_length': 2.6852477477477477, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '365905', 'n_tokens_mistral': 2529, 'n_tokens_neox': 2451, 'n_words': 451}