<commit_before>=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::Web::Component::Gene::FamilyGenes;

### Displays information about all genes belonging to a protein family

use strict;

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

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

sub content {
  my $self         = shift;
  my $hub          = $self->hub;
  my $cdb          = shift || $hub->param('cdb') || 'compara';
  my $object       = $self->object;
  my $species      = $hub->species;
  my $species_defs = $hub->species_defs;
  my $family_id    = $hub->param('family');
  my $spath        = $species_defs->species_path($species);
  my $html         = undef;

  if ($family_id) {
    my $families = $object->get_all_families($cdb);
    my $genes    = $families->{$family_id}{'info'}{'genes'} || [];
    my $proteins = $families->{$family_id}{'info'}{'proteins'} || {};

    ## Dedupe results
    my %seen;
    foreach (@$genes) {
      next if $seen{$_->stable_id};
      $seen{$_->stable_id} = $_;
    }
    my @unique_genes = values %seen;

    $html       .= "<h4>Ensembl genes containing proteins in family $family_id</h4>\n";

    ## Karyotype (optional)
    if (@{$species_defs->ENSEMBL_CHROMOSOMES}) {<commit_msg>Added a link from the family+karyotype view to the family description<commit_after>=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::Web::Component::Gene::FamilyGenes;

### Displays information about all genes belonging to a protein family

use strict;

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

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

sub content {
  my $self         = shift;
  my $hub          = $self->hub;
  my $cdb          = shift || $hub->param('cdb') || 'compara';
  my $object       = $self->object;
  my $species      = $hub->species;
  my $species_defs = $hub->species_defs;
  my $family_id    = $hub->param('family');
  my $spath        = $species_defs->species_path($species);
  my $html         = undef;
  my $ckey         = $cdb eq 'compara_pan_ensembl' ? '_pan_compara' : '';

  if ($family_id) {
    my $families = $object->get_all_families($cdb);
    my $genes    = $families->{$family_id}{'info'}{'genes'} || [];
    my $proteins = $families->{$family_id}{'info'}{'proteins'} || {};

    ## Dedupe results
    my %seen;
    foreach (@$genes) {
      next if $seen{$_->stable_id};
      $seen{$_->stable_id} = $_;
    }
    my @unique_genes = values %seen;

    my $url_fam  = $hub->url({ species => 'Multi', type => "Family$ckey", action => 'Details', fm => $family_id, __clear => 1 });
    $html       .= sprintf qq(<h4>Ensembl genes containing proteins in family <a href="%s">$family_id</a></h4>\n), $url_fam;

    ## Karyotype (optional)
    if (@{$species_defs->ENSEMBL_CHROMOSOMES}) {
{'fraction_non_alphanumeric': 0.13484228268721407, 'fraction_numerical': 0.010353960992053936, 'mean_word_length': 3.6104328523862375, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2134522', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1293, 'n_words': 410}