@@ -26,14 +26,17 @@ use URI::Escape qw(uri_escape);
26
26
use IO::String;
27
27
use Bio::AlignIO;
28
28
29
+ use EnsEMBL::Web::Constants;
30
+
29
31
use base qw( EnsEMBL::Web::ZMenu) ;
30
32
31
33
sub content {
32
34
my $self = shift ;
33
35
my $cdb = shift || ' compara' ;
34
36
my $hub = $self -> hub;
35
37
my $object = $self -> object;
36
- my $strain_tree = $hub -> species_defs-> get_config($self -> hub-> species,' RELATED_TAXON' ) if $hub -> param(' strain' );
38
+ my $is_strain = $hub -> param(' strain' );
39
+ my $strain_tree = $hub -> species_defs-> get_config($self -> hub-> species,' RELATED_TAXON' ) if $is_strain ;
37
40
my $tree = $object -> isa(' EnsEMBL::Web::Object::GeneTree' ) ? $object -> tree : $object -> get_GeneTree($cdb , " " , $strain_tree );
38
41
39
42
die ' No tree for gene' unless $tree ;
@@ -165,6 +168,7 @@ sub content {
165
168
166
169
}
167
170
171
+ my $gene_tree_constants = EnsEMBL::Web::Constants::GENE_TREE_CONSTANTS($cdb , $is_strain , $tree -> tree-> clusterset_id);
168
172
my $lookup = $hub -> species_defs-> prodnames_to_urls_lookup;
169
173
if ($is_leaf and $is_supertree ) {
170
174
@@ -177,9 +181,6 @@ sub content {
177
181
178
182
my $link_gene = $node -> {_sub_reference_gene };
179
183
180
- # # Strain trees and other trees are very different!
181
- my $action = $hub -> param(' strain' ) ? ' Strain_Compara_Tree' : ' Compara_Tree' ;
182
-
183
184
my $that_subtree_link ;
184
185
if ($tree_stable_id ) {
185
186
$that_subtree_link = $hub -> url({
@@ -193,27 +194,10 @@ sub content {
193
194
my $link_gene = $node -> {_sub_reference_gene };
194
195
my $species = $lookup -> {$link_gene -> genome_db-> name};
195
196
196
- # This is not the most elegant approach, but it will change the $action
197
- # only where gene-tree constants are available (e.g. Metazoa),
198
- # and only for non-default protein trees that lack a stable ID.
199
- require EnsEMBL::Web::Component::Gene::ComparaOrthologs;
200
- if (defined $EnsEMBL::Web::Component::Gene::ComparaOrthologs::GENE_TREE_CONSTANTS ) {
201
- my $gene_tree_constants = $EnsEMBL::Web::Component::Gene::ComparaOrthologs::GENE_TREE_CONSTANTS ;
202
- if (defined $gene_tree_constants ) {
203
- my $clusterset_id = $tree -> tree-> clusterset_id;
204
- if (exists $gene_tree_constants -> {$clusterset_id }) {
205
- my $clusterset_specific_action = $gene_tree_constants -> {$clusterset_id }{url_part };
206
- if (defined $clusterset_specific_action ) {
207
- $action = $clusterset_specific_action ;
208
- }
209
- }
210
- }
211
- }
212
-
213
197
$that_subtree_link = $hub -> url({
214
198
species => $species ,
215
199
type => ' Gene' ,
216
- action => $action ,
200
+ action => $gene_tree_constants -> { action } ,
217
201
__clear => 1,
218
202
g => $link_gene -> stable_id,
219
203
});
@@ -387,11 +371,13 @@ sub content {
387
371
my $params = {
388
372
' type' => ' DataExport' ,
389
373
' action' => ' GeneTree' ,
374
+ ' cdb' => $cdb ,
390
375
' data_type' => ' Gene' ,
391
- ' component' => ' ComparaTree ' ,
376
+ ' component' => $gene_tree_constants -> { component } ,
392
377
' gene_name' => $gene_name ,
393
378
' align' => ' tree' ,
394
379
' node' => $node_id ,
380
+ ' strain' => $is_strain ,
395
381
};
396
382
397
383
$self -> add_entry({
0 commit comments