Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add homoeologues page and menu item - initially only for Triticum aes…

…tivum
  • Loading branch information...
commit 3ef9acbba35b9ebf09fb355e69a9bef202f85dff 1 parent 2058a7d
Nick Langridge nicklangridge authored
225 modules/EnsEMBL/Web/Component/Gene/ComparaHomoeologs.pm
View
@@ -0,0 +1,225 @@
+=head1 LICENSE
+
+Copyright [1999-2014] Wellcome Trust Sanger Institute and the 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::ComparaHomoeologs;
+
+use strict;
+
+use HTML::Entities qw(encode_entities);
+
+use base qw(EnsEMBL::Web::Component::Gene);
+
+sub _init {
+ my $self = shift;
+ $self->cacheable(1);
+ $self->ajaxable(1);
+}
+
+sub content {
+ my $self = shift;
+ my $hub = $self->hub;
+ my $object = $self->object;
+ my $species_defs = $hub->species_defs;
+ my $cdb = shift || $hub->param('cdb') || 'compara';
+ my $availability = $object->availability;
+
+ my @homoeologues = (
+ $object->get_homology_matches('ENSEMBL_HOMOEOLOGUES', 'homoeolog', undef, $cdb),
+ );
+
+ my %homoeologue_list;
+ my %skipped;
+
+ foreach my $homology_type (@homoeologues) {
+ foreach (keys %$homology_type) {
+ (my $species = $_) =~ tr/ /_/;
+ $homoeologue_list{$species} = {%{$homoeologue_list{$species}||{}}, %{$homology_type->{$_}}};
+ $skipped{$species} += keys %{$homology_type->{$_}} if $hub->param('species_' . lc $species) eq 'off';
+ }
+ }
+
+ return '<p>No homoeologues have been identified for this gene</p>' unless keys %homoeologue_list;
+
+ my %homoeologue_map = qw(SEED BRH PIP RHS);
+ my $alignview = 0;
+
+ my ($html, $columns, @rows);
+
+ my $column_name = $self->html_format ? 'Compare' : 'Description';
+
+ my $columns = [
+ { key => 'Species', align => 'left', width => '10%', sort => 'html' },
+ { key => 'Type', align => 'left', width => '5%', sort => 'string' },
+ { key => 'dN/dS', align => 'left', width => '5%', sort => 'numeric' },
+ { key => 'identifier', align => 'left', width => '15%', sort => 'html', title => $self->html_format ? 'Ensembl identifier &amp; gene name' : 'Ensembl identifier'},
+ { key => $column_name, align => 'left', width => '10%', sort => 'none' },
+ { key => 'Location', align => 'left', width => '20%', sort => 'position_html' },
+ { key => 'Target %id', align => 'left', width => '5%', sort => 'numeric' },
+ { key => 'Query %id', align => 'left', width => '5%', sort => 'numeric' },
+ ];
+
+ push @$columns, { key => 'Gene name(Xref)', align => 'left', width => '15%', sort => 'html', title => 'Gene name(Xref)'} if(!$self->html_format);
+
+ @rows = ();
+
+ foreach my $species (sort { ($a =~ /^<.*?>(.+)/ ? $1 : $a) cmp ($b =~ /^<.*?>(.+)/ ? $1 : $b) } keys %homoeologue_list) {
+ next if $skipped{$species};
+
+ foreach my $stable_id (sort keys %{$homoeologue_list{$species}}) {
+ my $homoeologue = $homoeologue_list{$species}{$stable_id};
+ my ($target, $query);
+
+ # (Column 2) Add in homoeologue description
+ my $homoeologue_desc = $homoeologue_map{$homoeologue->{'homology_desc'}} || $homoeologue->{'homology_desc'};
+
+ # (Column 3) Add in the dN/dS ratio
+ my $homoeologue_dnds_ratio = $homoeologue->{'homology_dnds_ratio'} || 'n/a';
+
+ # (Column 4) Sort out
+ # (1) the link to the other species
+ # (2) information about %ids
+ # (3) links to multi-contigview and align view
+ (my $spp = $homoeologue->{'spp'}) =~ tr/ /_/;
+ my $link_url = $hub->url({
+ species => $spp,
+ action => 'Summary',
+ g => $stable_id,
+ __clear => 1
+ });
+
+ # Check the target species are on the same portal - otherwise the multispecies link does not make sense
+ my $target_links = ($link_url =~ /^\//
+ && $cdb eq 'compara'
+ && $availability->{'has_pairwise_alignments'}
+ ) ? sprintf(
+ '<ul class="compact"><li class="first"><a href="%s" class="notext">Region Comparison</a></li>',
+ $hub->url({
+ type => 'Location',
+ action => 'Multi',
+ g1 => $stable_id,
+ s1 => $spp,
+ r => undef,
+ config => 'opt_join_genes_bottom=on',
+ })
+ ) : '';
+
+ if ($homoeologue_desc ne 'DWGA') {
+ ($target, $query) = ($homoeologue->{'target_perc_id'}, $homoeologue->{'query_perc_id'});
+
+ my $align_url = $hub->url({
+ action => 'Compara_Homoeolog',
+ function => 'Alignment' . ($cdb =~ /pan/ ? '_pan_compara' : ''),
+ g1 => $stable_id,
+ });
+
+ unless ($object->Obj->biotype =~ /RNA/) {
+ $target_links .= sprintf '<li><a href="%s" class="notext">Alignment (protein)</a></li>', $align_url;
+ }
+ $align_url .= ';seq=cDNA';
+ $target_links .= sprintf '<li><a href="%s" class="notext">Alignment (cDNA)</a></li>', $align_url;
+
+ $alignview = 1;
+ }
+
+ $target_links .= sprintf(
+ '<li><a href="%s" class="notext">Gene Tree (image)</a></li></ul>',
+ $hub->url({
+ type => 'Gene',
+ action => 'Compara_Tree' . ($cdb =~ /pan/ ? '/pan_compara' : ''),
+ g1 => $stable_id,
+ anc => $homoeologue->{'gene_tree_node_id'},
+ r => undef
+ })
+ );
+
+ # (Column 5) External ref and description
+ my $description = encode_entities($homoeologue->{'description'});
+ $description = 'No description' if $description eq 'NULL';
+
+ if ($description =~ s/\[\w+:([-\/\w]+)\;\w+:(\w+)\]//g) {
+ my ($edb, $acc) = ($1, $2);
+ $description .= sprintf '[Source: %s; acc: %s]', $edb, $hub->get_ExtURL_link($acc, $edb, $acc) if $acc;
+ }
+
+ my @external = (qq{<span class="small">$description</span>});
+
+ if ($homoeologue->{'display_id'}) {
+ if ($homoeologue->{'display_id'} eq 'Novel Ensembl prediction' && $description eq 'No description') {
+ @external = ('<span class="small">-</span>');
+ } else {
+ unshift @external, $homoeologue->{'display_id'};
+ }
+ }
+
+ my $id_info = qq{<p class="space-below"><a href="$link_url">$stable_id</a></p>} . join '<br />', @external;
+
+ ## (Column 6) Location - split into elements to reduce horizonal space
+ my $location_link = $hub->url({
+ species => $spp,
+ type => 'Location',
+ action => 'View',
+ r => $homoeologue->{'location'},
+ g => $stable_id,
+ __clear => 1
+ });
+
+ my $table_details = {
+ 'Species' => join('<br />(', split /\s*\(/, $species_defs->species_label($species)),
+ 'Type' => ucfirst $homoeologue_desc,
+ 'dN/dS' => $homoeologue_dnds_ratio,
+ 'identifier' => $self->html_format ? $id_info : $stable_id,
+ 'Location' => qq{<a href="$location_link">$homoeologue->{'location'}</a>},
+ $column_name => $self->html_format ? qq{<span class="small">$target_links</span>} : $description,
+ 'Target %id' => $target,
+ 'Query %id' => $query
+ };
+ $table_details->{'Gene name(Xref)'}=$homoeologue->{'display_id'} if(!$self->html_format);
+
+ push @rows, $table_details;
+ }
+ }
+
+ my $table = $self->new_table($columns, \@rows, { data_table => 1, sorting => [ 'Species asc', 'Type asc' ], id => 'homoeologues' });
+
+ if ($alignview && keys %homoeologue_list) {
+ # PREpend
+ $html = sprintf(
+ '<p><a href="%s">View sequence alignments of all homoeologues</a>.</p>',
+ $hub->url({ action => 'Compara_Homoeolog', function => 'Alignment' . ($cdb =~ /pan/ ? '_pan_compara' : ''), })
+ ).$html;
+ }
+
+ $html .= $table->render;
+
+ if (scalar keys %skipped) {
+ my $count;
+ $count += $_ for values %skipped;
+
+ $html .= '<br />' . $self->_info(
+ 'homoeologues hidden by configuration',
+ sprintf(
+ '<p>%d homoeologues not shown in the table above from the following species. Use the "<strong>Configure this page</strong>" on the left to show them.<ul><li>%s</li></ul></p>',
+ $count,
+ join "</li>\n<li>", map "$_ ($skipped{$_})", sort keys %skipped
+ )
+ );
+ }
+ return $html;
+}
+
+1;
98 modules/EnsEMBL/Web/Component/Gene/HomologAlignment.pm 100644 → 100755
View
@@ -23,7 +23,6 @@ package EnsEMBL::Web::Component::Gene::HomologAlignment;
use strict;
use Bio::AlignIO;
-use List::MoreUtils qw{ none any };
use EnsEMBL::Web::Constants;
@@ -31,6 +30,7 @@ sub content {
my $self = shift;
my $hub = $self->hub;
my $cdb = shift || $hub->param('cdb') || 'compara';
+
my $species = $hub->species;
my $species_defs = $hub->species_defs;
my $gene_id = $self->object->stable_id;
@@ -38,37 +38,52 @@ sub content {
my $seq = $hub->param('seq');
my $text_format = $hub->param('text_format');
my $database = $hub->database($cdb);
- my $qm = $database->get_MemberAdaptor->fetch_by_source_stable_id('ENSEMBLGENE', $gene_id);
+ my $qm = $database->get_GeneMemberAdaptor->fetch_by_source_stable_id('ENSEMBLGENE', $gene_id);
my ($homologies, $html, %skipped);
-
+
eval {
$homologies = $database->get_HomologyAdaptor->fetch_all_by_Member($qm);
};
-
- my %desc_mapping = (
- ortholog_one2one => '1 to 1 orthologue',
- apparent_ortholog_one2one => '1 to 1 orthologue (apparent)',
- ortholog_one2many => '1 to many orthologue',
- between_species_paralog => 'paralogue (between species)',
- ortholog_many2many => 'many to many orthologue',
- within_species_paralog => 'paralogue (within species)',
- other_paralog => 'other paralogue (within species)',
- );
- my @orthologues = qw/ortholog_one2one apparent_ortholog_one2one ortholog_one2many ortholog_many2many possible_ortholog/;
- my @paralogues = ('other_paralog', 'between_species_paralog', 'within_species_paralog');
- my @list_to_show = ();
-
- if ( ($hub->referer->{'ENSEMBL_ACTION'} eq 'Compara_Paralog' && $hub->referer->{'ENSEMBL_FUNCTION'} eq 'Alignment_pan_compara')
- || ($hub->referer->{'ENSEMBL_ACTION'} eq 'Compara_Paralog' && $hub->referer->{'ENSEMBL_FUNCTION'} eq 'Alignment') ) {
- @list_to_show = (@paralogues);
- }
- if ( ($hub->referer->{'ENSEMBL_ACTION'} eq 'Compara_Ortholog' && $hub->referer->{'ENSEMBL_FUNCTION'} eq 'Alignment_pan_compara')
- || ( $hub->referer->{'ENSEMBL_ACTION'} eq 'Compara_Ortholog' && $hub->referer->{'ENSEMBL_FUNCTION'} eq 'Alignment')){
- @list_to_show = (@orthologues);
+ my ($match_type, %desc_mapping);
+
+ if ($hub->action eq 'Compara_Ortholog') {
+ $match_type = 'Orthologue';
+ %desc_mapping = (
+ ortholog_one2one => '1 to 1 orthologue',
+ apparent_ortholog_one2one => '1 to 1 orthologue (apparent)',
+ ortholog_one2many => '1 to many orthologue',
+ ortholog_many2many => 'many to many orthologue',
+ possible_ortholog => 'possible orthologue',
+ );
+ }
+## EG
+ elsif ($hub->action eq 'Compara_Homoeolog') {
+ $match_type = 'Homoeologue';
+ %desc_mapping = (
+ homoeolog_one2one => '1-to-1',
+ homoeolog_one2many => '1-to-many',
+ homoeolog_many2many => 'many-to-many',
+ );
+ }
+##
+ else {
+ $match_type = 'Paralogue';
+ %desc_mapping = (
+ within_species_paralog => 'paralogue (within species)',
+ putative_gene_split => 'putative gene split',
+ contiguous_gene_split => 'contiguous gene split',
+ );
}
-
+
+ my $homology_types = EnsEMBL::Web::Constants::HOMOLOGY_TYPES;
+
foreach my $homology (@{$homologies}) {
+
+ ## filter out non-required types
+ my $homology_desc = $homology_types->{$homology->{'_description'}} || $homology->{'_description'};
+ next unless $desc_mapping{$homology_desc};
+
my $sa;
eval {
@@ -100,6 +115,7 @@ sub content {
$peptide->stable_id,
sprintf('%d aa', $peptide->seq_length),
sprintf('%d %%', $peptide->perc_id),
+ sprintf('%d %%', $peptide->perc_cov),
$location,
];
} else {
@@ -115,6 +131,7 @@ sub content {
),
sprintf('%d aa', $peptide->seq_length),
sprintf('%d %%', $peptide->perc_id),
+ sprintf('%d %%', $peptide->perc_cov),
sprintf('<a href="%s">%s</a>',
$hub->url({ species => $member_species, type => 'Location', action => 'View', g => $gene->stable_id, r => $location, t => undef }),
$location
@@ -125,24 +142,19 @@ sub content {
next unless $flag;
- my $homology_types = EnsEMBL::Web::Constants::HOMOLOGY_TYPES;
- my $homology_desc = $homology_types->{$homology->{'_description'}} || $homology->{'_description'};
-
- next if
- none { $homology_desc eq $_ } @list_to_show;
-
my $homology_desc_mapped = $desc_mapping{$homology_desc} ? $desc_mapping{$homology_desc} :
$homology_desc ? $homology_desc : 'no description';
- $html .= "<h2>Homologue type: $homology_desc_mapped</h2>";
+ $html .= "<h2>$match_type type: $homology_desc_mapped</h2>";
my $ss = $self->new_table([
- { title => 'Species', width => '18%' },
- { title => 'Gene ID', width => '18%' },
- { title => 'Peptide ID', width => '18%' },
- { title => 'Peptide length', width => '13%' },
- { title => '% identity', width => '13%' },
- { title => 'Genomic location', width => '20%' }
+ { title => 'Species', width => '15%' },
+ { title => 'Gene ID', width => '15%' },
+ { title => 'Peptide ID', width => '15%' },
+ { title => 'Peptide length', width => '10%' },
+ { title => '% identity', width => '10%' },
+ { title => '% coverage', width => '10%' },
+ { title => 'Genomic location', width => '25%' }
],
$data
);
@@ -178,18 +190,20 @@ sub content {
$html .= "<pre>$var</pre>";
}
}
+
if (scalar keys %skipped) {
my $count;
$count += $_ for values %skipped;
-
- $html .= '<br />' . $self->_info(
- 'Orthologues hidden by configuration',
+## EG
+ $html .= '<br />' . $self->_info(
+ "${match_type}s hidden by configuration",
sprintf(
- '<p>%d orthologues not shown in the table above from the following species. Use the "<strong>Configure this page</strong>" on the left to show them.<ul><li>%s</li></ul></p>',
+ '<p>%d ${match_type}s not shown in the table above from the following species. Use the "<strong>Configure this page</strong>" on the left to show them.<ul><li>%s</li></ul></p>',
$count,
join "</li>\n<li>", map "$_ ($skipped{$_})", sort keys %skipped
)
);
+##
}
return $html;
18 modules/EnsEMBL/Web/Configuration/Gene.pm 100644 → 100755
View
@@ -25,7 +25,6 @@ sub modify_tree {
my $species = $hub->species;
my $species_defs = $hub->species_defs;
my $object = $self->object;
-
my $summary = $self->get_node('Summary');
# my $splice = $self->get_node('Splice');
@@ -124,6 +123,23 @@ sub modify_tree {
$compara_menu->set('caption', $cdb_name);
+ # We only have homoeologues for Triticum aestivum (Plants).
+ # For other genomes we don't want this menu to be visible at all (because people don't know what they are).
+ # If we get homoeologue data for other species we should find a better way to control this.
+ if ($hub->species =~ /triticum_aestivum/i) {
+ $self->get_node('Compara_Paralog')->after(
+ $self->create_node('Compara_Homoeolog', 'Homoeologues ([[counts::homoeologs]])',
+ [qw(paralogues EnsEMBL::Web::Component::Gene::ComparaHomoeologs)],
+ { 'availability' => 'gene database:compara core has_homoeologs', 'concise' => 'Homoeologues' }
+ ),
+ $self->create_node('Compara_Homoeolog/Alignment', 'Homoeologue alignment',
+ [qw( alignment EnsEMBL::Web::Component::Gene::HomologAlignment )],
+ { 'availability' => 'gene database:compara core has_homoeologs', 'no_menu_entry' => 1 }
+ )
+ );
+ }
+
+
##----------------------------------------------------------------------
## Compara menu: alignments/orthologs/paralogs/trees
my $pancompara_menu = $self->create_node( 'PanCompara', 'Pan-taxonomic Compara',
169 modules/EnsEMBL/Web/Object/Gene.pm
View
@@ -22,81 +22,40 @@ package EnsEMBL::Web::Object::Gene;
use Data::Dumper;
-sub counts {
- my $self = shift;
- my $obj = $self->Obj;
+use previous qw(counts availability);
- return {} unless $obj->isa('Bio::EnsEMBL::Gene');
-
- my $key = sprintf '::COUNTS::GENE::%s::%s::%s::', $self->species, $self->hub->core_param('db'), $self->hub->core_param('g');
- my $counts = $self->{'_counts'};
- $counts ||= $MEMD->get($key) if $MEMD;
-
- if (!$counts) {
- $counts = {
- transcripts => scalar @{$obj->get_all_Transcripts},
- exons => scalar @{$obj->get_all_Exons},
- similarity_matches => $self->get_xref_available,
- operons => 0,
- };
- if ($obj->feature_Slice->can('get_all_Operons')){
- $counts->{'operons'} = scalar @{$obj->feature_Slice->get_all_Operons};
- }
- $counts->{structural_variation} = 0;
- if ($self->database('variation')){
- my $vdb = $self->species_defs->get_config($self->species,'databases')->{'DATABASE_VARIATION'};
- $counts->{structural_variation} = $vdb->{'tables'}{'structural_variation'}{'rows'};
- }
- my $compara_db = $self->database('compara');
+sub availability {
+ $self = shift;
+ $self->PREV::availability(@_);
+
+ my $obj = $self->Obj;
- if ($compara_db) {
- my $compara_dbh = $compara_db->get_MemberAdaptor->dbc->db_handle;
-
- if ($compara_dbh) {
- $counts = {%$counts, %{$self->count_homologues($compara_dbh)}};
-
- my ($res) = $compara_dbh->selectrow_array(
- 'select count(*) from family_member fm, member as m where fm.member_id=m.member_id and stable_id=? and source_name =?',
- {}, $obj->stable_id, 'ENSEMBLGENE'
- );
-
- $counts->{'families'} = $res;
- }
- my $alignments = $self->count_alignments;
- $counts->{'alignments'} = $alignments->{'all'} if $self->get_db eq 'core';
- $counts->{'pairwise_alignments'} = $alignments->{'pairwise'} + $alignments->{'patch'};
- }
- if (my $compara_db = $self->database('compara_pan_ensembl')) {
- my $compara_dbh = $compara_db->get_MemberAdaptor->dbc->db_handle;
+ if ($obj->isa('Bio::EnsEMBL::Gene')) {
+ my $member = $self->database('compara') ? $self->database('compara')->get_GeneMemberAdaptor->fetch_by_source_stable_id('ENSEMBLGENE', $obj->stable_id) : undef;
+ my $pan_member = $self->database('compara_pan_ensembl') ? $self->database('compara_pan_ensembl')->get_GeneMemberAdaptor->fetch_by_source_stable_id('ENSEMBLGENE', $obj->stable_id) : undef;
+ my $counts = $self->counts($member, $pan_member);
+
+ $self->{_availability}->{has_homoeologs} = $counts->{homoeologs};
+ }
- my $pan_counts = {};
+ return $self->{_availability};
+}
- if ($compara_dbh) {
- $pan_counts = $self->count_homologues($compara_dbh);
-
- my ($res) = $compara_dbh->selectrow_array(
- 'select count(*) from family_member fm, member as m where fm.member_id=m.member_id and stable_id=? and source_name =?',
- {}, $obj->stable_id, 'ENSEMBLGENE'
- );
-
- $pan_counts->{'families'} = $res;
- }
-
- $pan_counts->{'alignments'} = $self->count_alignments('DATABASE_COMPARA_PAN_ENSEMBL')->{'all'} if $self->get_db eq 'core';
+sub _counts {
+ my ($self, $member, $pan_member) = @_;
+ my $obj = $self->Obj;
- foreach (keys %$pan_counts) {
- my $key = $_."_pan";
- $counts->{$key} = $pan_counts->{$_};
- }
+ return {} unless $obj->isa('Bio::EnsEMBL::Gene');
+
+ my $counts = $self->{'_counts'};
+
+ if (!$counts) {
+ if ($member) {
+ $counts->{'homoeologs'} = $member->number_of_homoeologues;
}
-
- $counts = {%$counts, %{$self->_counts}};
-
- $MEMD->set($key, $counts, undef, 'COUNTS') if $MEMD;
- $self->{'_counts'} = $counts;
}
-
- return $counts;
+
+ return $counts || {};
}
sub store_TransformedTranscripts {
@@ -282,5 +241,79 @@ sub gene_type {
return $type;
}
+## EG - add homoeolog descriptions
+sub get_homology_matches {
+ my ($self, $homology_source, $homology_description, $disallowed_homology, $compara_db) = @_;
+ #warn ">>> MATCHING $homology_source, $homology_description BUT NOT $disallowed_homology";
+
+ $homology_source ||= 'ENSEMBL_HOMOLOGUES';
+ $homology_description ||= 'ortholog';
+ $compara_db ||= 'compara';
+
+ my $key = "$homology_source::$homology_description";
+
+ if (!$self->{'homology_matches'}{$key}) {
+ my $homologues = $self->fetch_homology_species_hash($homology_source, $homology_description, $compara_db);
+
+ return $self->{'homology_matches'}{$key} = {} unless keys %$homologues;
+
+ my $gene = $self->Obj;
+ my $geneid = $gene->stable_id;
+ my $adaptor_call = $self->param('gene_adaptor') || 'get_GeneAdaptor';
+ my %homology_list;
+
+ # Convert descriptions into more readable form
+ my %desc_mapping = (
+ ortholog_one2one => '1-to-1',
+ apparent_ortholog_one2one => '1-to-1 (apparent)',
+ ortholog_one2many => '1-to-many',
+ possible_ortholog => 'possible ortholog',
+ ortholog_many2many => 'many-to-many',
+ within_species_paralog => 'paralogue (within species)',
+ other_paralog => 'other paralogue (within species)',
+ putative_gene_split => 'putative gene split',
+ contiguous_gene_split => 'contiguous gene split',
+## EG
+ homoeolog_one2one => '1-to-1',
+ homoeolog_one2many => '1-to-many',
+ homoeolog_many2many => 'many-to-many',
+##
+ );
+
+ foreach my $display_spp (keys %$homologues) {
+ my $order = 0;
+
+ foreach my $homology (@{$homologues->{$display_spp}}) {
+ my ($homologue, $homology_desc, $homology_subtype, $query_perc_id, $target_perc_id, $dnds_ratio, $gene_tree_node_id) = @$homology;
+
+ next unless $homology_desc =~ /$homology_description/;
+ next if $disallowed_homology && $homology_desc =~ /$disallowed_homology/;
+
+ # Avoid displaying duplicated (within-species and other paralogs) entries in the homology table (e!59). Skip the other_paralog (or overwrite it)
+ next if $homology_list{$display_spp}{$homologue->stable_id} && $homology_desc eq 'other_paralog';
+
+ $homology_list{$display_spp}{$homologue->stable_id} = {
+ homology_desc => $desc_mapping{$homology_desc} || 'no description',
+ description => $homologue->description || 'No description',
+ display_id => $homologue->display_label || 'Novel Ensembl prediction',
+ homology_subtype => $homology_subtype,
+ spp => $display_spp,
+ query_perc_id => $query_perc_id,
+ target_perc_id => $target_perc_id,
+ homology_dnds_ratio => $dnds_ratio,
+ gene_tree_node_id => $gene_tree_node_id,
+ order => $order,
+ location => sprintf('%s:%s-%s:%s', map $homologue->$_, qw(chr_name chr_start chr_end chr_strand))
+ };
+
+ $order++;
+ }
+ }
+
+ $self->{'homology_matches'}{$key} = \%homology_list;
+ }
+
+ return $self->{'homology_matches'}{$key};
+}
1;
Please sign in to comment.
Something went wrong with that request. Please try again.