Skip to content

Commit e3c5c1c

Browse files
author
ens_adm02
committed
Merging postreleasefix/114 to main
* postreleasefix/114: Tweak handling of strain, Pan and subtree export (#1074) Load underlying slices iff needed for alignslice view (#1076) Update Apache access logs format: print request ips (#1077)
2 parents b57aff7 + 0d92b20 commit e3c5c1c

File tree

5 files changed

+45
-25
lines changed

5 files changed

+45
-25
lines changed

conf/httpd.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ LogFormat ":%{X-Forwarded-For}i %v %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-
453453
<IfDefine !ec2>
454454
# this for live at Hinx
455455
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
456-
LogFormat "[%P/%{ENSEMBL_CHILD_COUNT}e %{ENSEMBL_SCRIPT_TIME}e %{outstream}n/%{instream}n=%{ratio}n] %h/%{HTTP_X_FORWARDED_FOR}e %l/%{ENSEMBL_SESSION_ID}e %u/%{ENSEMBL_USER_ID}e %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{HTTP_X_Requested_With}e\" %{ENSEMBL_SCRIPT_START}e/%{ENSEMBL_SCRIPT_END}e" ensembl_extended
456+
LogFormat "[%P/%{ENSEMBL_CHILD_COUNT}e %{ENSEMBL_SCRIPT_TIME}e %{outstream}n/%{instream}n=%{ratio}n] %h/%{X-Cluster-Client-Ip}i %l/%{ENSEMBL_SESSION_ID}e %u/%{ENSEMBL_USER_ID}e %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{HTTP_X_Requested_With}e\" %{ENSEMBL_SCRIPT_START}e/%{ENSEMBL_SCRIPT_END}e" ensembl_extended
457457
</IfDefine>
458458
#
459459
####

modules/EnsEMBL/Web/Command/DataExport/Output.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ sub process {
157157
$url_params->{'__clear'} = 1;
158158
## Pass parameters needed for Back button to work
159159
my @core_params = keys %{$hub->core_object('parameters')};
160-
push @core_params, qw(export_action data_type data_action component align g1);
160+
push @core_params, qw(export_action data_type data_action component align g1 node strain);
161161
push @core_params, $self->config_params;
162162
foreach (@core_params) {
163163
my @values = $component->param($_);

modules/EnsEMBL/Web/Component/Location/Compara_AlignSliceBottom.pm

+3
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ sub content {
6464
));
6565
}
6666

67+
my $need_underlying_slices = !$self->has_image || $align_details->{'class'} eq 'GenomicAlignTree.ancestral_alignment';
6768
my $image_width = $self->image_width;
6869
my $slice = $object->slice;
6970
my %export_params = $hub->param('data_type') ? ('data_type' => $hub->param('data_type'), 'component' => $hub->param('data_action'))
7071
: ();
7172
my ($slices) = $object->get_slices({
7273
'slice' => $slice,
7374
'align' => $align_params,
75+
'image' => !$need_underlying_slices,
7476
'species' => $primary_species,
7577
%export_params
7678
});
@@ -136,6 +138,7 @@ sub content {
136138
'species' => $prodname,
137139
'cdb' => $self->param('cdb') || 'compara',
138140
'ignore' => 'ancestral_sequences',
141+
'image' => !$need_underlying_slices,
139142
});
140143

141144
return $alert_box if $error;

modules/EnsEMBL/Web/Constants.pm

+31
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,37 @@ sub GENE_JOIN_TYPES {
199199
}
200200
}
201201

202+
sub GENE_TREE_CONSTANTS {
203+
### Compara lookup for various gene-tree views
204+
my ($cdb, $strain, $clusterset_id) = @_;
205+
206+
my $GENE_TREE_CONSTANTS = {
207+
compara_pan_ensembl => {
208+
action => 'PanComparaTree',
209+
component => 'PanComparaTree',
210+
},
211+
compara_strain => {
212+
action => 'Strain_Compara_Tree',
213+
component => 'ComparaTree',
214+
},
215+
compara => {
216+
action => 'Compara_Tree',
217+
component => 'ComparaTree',
218+
},
219+
};
220+
221+
my $gene_tree_view_key;
222+
if ($cdb eq 'compara_pan_ensembl') {
223+
$gene_tree_view_key = 'compara_pan_ensembl';
224+
} elsif ($strain) {
225+
$gene_tree_view_key = 'compara_strain';
226+
} else {
227+
$gene_tree_view_key = 'compara';
228+
}
229+
230+
return $GENE_TREE_CONSTANTS->{$gene_tree_view_key};
231+
}
232+
202233
sub ALIGNMENT_FORMATS {
203234
### Metadata for alignment export formats
204235
return (

modules/EnsEMBL/Web/ZMenu/ComparaTreeNode.pm

+9-23
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ use URI::Escape qw(uri_escape);
2626
use IO::String;
2727
use Bio::AlignIO;
2828

29+
use EnsEMBL::Web::Constants;
30+
2931
use base qw(EnsEMBL::Web::ZMenu);
3032

3133
sub content {
3234
my $self = shift;
3335
my $cdb = shift || 'compara';
3436
my $hub = $self->hub;
3537
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;
3740
my $tree = $object->isa('EnsEMBL::Web::Object::GeneTree') ? $object->tree : $object->get_GeneTree($cdb, "", $strain_tree);
3841

3942
die 'No tree for gene' unless $tree;
@@ -165,6 +168,7 @@ sub content {
165168

166169
}
167170

171+
my $gene_tree_constants = EnsEMBL::Web::Constants::GENE_TREE_CONSTANTS($cdb, $is_strain, $tree->tree->clusterset_id);
168172
my $lookup = $hub->species_defs->prodnames_to_urls_lookup;
169173
if ($is_leaf and $is_supertree) {
170174

@@ -177,9 +181,6 @@ sub content {
177181

178182
my $link_gene = $node->{_sub_reference_gene};
179183

180-
## Strain trees and other trees are very different!
181-
my $action = $hub->param('strain') ? 'Strain_Compara_Tree' : 'Compara_Tree';
182-
183184
my $that_subtree_link;
184185
if ($tree_stable_id) {
185186
$that_subtree_link = $hub->url({
@@ -193,27 +194,10 @@ sub content {
193194
my $link_gene = $node->{_sub_reference_gene};
194195
my $species = $lookup->{$link_gene->genome_db->name};
195196

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-
213197
$that_subtree_link = $hub->url({
214198
species => $species,
215199
type => 'Gene',
216-
action => $action,
200+
action => $gene_tree_constants->{action},
217201
__clear => 1,
218202
g => $link_gene->stable_id,
219203
});
@@ -387,11 +371,13 @@ sub content {
387371
my $params = {
388372
'type' => 'DataExport',
389373
'action' => 'GeneTree',
374+
'cdb' => $cdb,
390375
'data_type' => 'Gene',
391-
'component' => 'ComparaTree',
376+
'component' => $gene_tree_constants->{component},
392377
'gene_name' => $gene_name,
393378
'align' => 'tree',
394379
'node' => $node_id,
380+
'strain' => $is_strain,
395381
};
396382

397383
$self->add_entry({

0 commit comments

Comments
 (0)