Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
6d268fa9
Commit
6d268fa9
authored
May 19, 2016
by
Leo Gordon
Browse files
introduced DisplayJobLength to protect and limit the output of input_ids in DisplayJobs>0 mode
parent
fde618c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
+30
-16
hive_config.json
hive_config.json
+1
-0
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
+29
-16
No files found.
hive_config.json
View file @
6d268fa9
...
...
@@ -108,6 +108,7 @@
"DisplayStats"
:
"barchart"
,
"DisplayJobs"
:
0
,
"DisplayJobLength"
:
64
,
"DisplayData"
:
0
,
"DisplayConditionLength"
:
64
,
"DisplayInputIDTemplate"
:
1
,
...
...
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
View file @
6d268fa9
...
...
@@ -339,6 +339,27 @@ sub _add_pipeline_label {
}
sub
_protect_for_display
{
my
(
$string
,
$length_limit
,
$drop_framing_curlies
)
=
@_
;
if
(
$drop_framing_curlies
)
{
$string
=~
s/^\{//
;
# drop leading curly
$string
=~
s/\}$//
;
# drop trailing curly
}
if
(
defined
(
$length_limit
))
{
$string
=~
s{^(.{$length_limit}
).+}
{$1 \.\.\.}
;
# shorten down to $length_limit characters
}
$string
=~
s{&}{&}g
;
# Since we are in HTML context now, ampersands should be escaped (first thing after trimming)
$string
=~
s{"}{"}g
;
# should fix a string display bug for pre-2.16 GraphViz'es
$string
=~
s{<}{<}g
;
$string
=~
s{>}{>}g
;
return
$string
;
}
sub
_add_analysis_node
{
my
(
$self
,
$analysis
)
=
@_
;
...
...
@@ -385,6 +406,8 @@ sub _add_analysis_node {
}
if
(
my
$job_limit
=
$self
->
config_get
('
DisplayJobs
')
)
{
my
$display_job_length
=
$self
->
config_get
('
DisplayJobLength
');
if
(
my
$job_adaptor
=
$analysis
->
adaptor
&&
$analysis
->
adaptor
->
db
->
get_AnalysisJobAdaptor
)
{
my
@jobs
=
sort
{
$a
->
dbID
<=>
$b
->
dbID
}
@
{
$job_adaptor
->
fetch_some_by_analysis_id_limit
(
$analysis
->
dbID
,
$job_limit
+
1
)};
$analysis
->
jobs_collection
(
\
@jobs
);
...
...
@@ -400,12 +423,10 @@ sub _add_analysis_node {
$analysis_label
.=
'
<tr><td colspan="
'
.
$colspan
.
'
"> </td></tr>
';
foreach
my
$job
(
@jobs
)
{
my
$input_id
=
$job
->
input_id
;
my
$input_id
=
_protect_for_display
(
$job
->
input_id
,
$display_job_length
,
1
)
;
my
$status
=
$job
->
status
;
my
$job_id
=
$job
->
dbID
||
'
unstored
';
$input_id
=~
s/\>/>/g
;
$input_id
=~
s/\</</g
;
$input_id
=~
s/\{|\}//g
;
$analysis_label
.=
qq{<tr><td align="left" colspan="$colspan" bgcolor="}
.
$self
->
config_get
('
Node
',
'
JobStatus
',
$status
,
'
Colour
')
.
qq{">$job_id [$status]: $input_id</td></tr>}
;
}
...
...
@@ -557,7 +578,6 @@ sub _twopart_arrow {
$df_targets
||=
$df_rule
->
get_my_targets
;
my
$choice
=
(
scalar
(
@$df_targets
)
!=
1
)
||
defined
(
$df_targets
->
[
0
]
->
on_condition
);
#my $label = scalar(@$df_targets)==1 ? 'Filter' : 'Switch';
my
$tablabel
=
qq{<<table border="0" cellborder="0" cellspacing="0" cellpadding="1">i<tr><td></td></tr>}
;
my
$targets_grouped_by_condition
=
$df_rule
->
get_my_targets_grouped_by_condition
(
$df_targets
);
...
...
@@ -566,17 +586,10 @@ sub _twopart_arrow {
my
$condition
=
$targets_grouped_by_condition
->
[
$i
]
->
[
0
];
if
(
$display_cond_length
)
{
if
(
defined
(
$condition
))
{
$condition
=~
s{^(.{$display_cond_length}
).+}
{$1 \.\.\.}
;
# shorten down to $display_cond_length characters
$condition
=~
s{&}{&}g
;
# Since we are in HTML context now, ampersands should be escaped (first thing after trimming)
$condition
=~
s{"}{"}g
;
# should fix a string display bug for pre-2.16 GraphViz'es
$condition
=~
s{<}{<}g
;
$condition
=~
s{>}{>}g
;
}
}
else
{
$condition
&&=
'
condition_
'
.
$i
;
if
(
defined
(
$condition
))
{
$condition
=
$display_cond_length
?
_protect_for_display
(
$condition
,
$display_cond_length
)
# trim and protect it
:
'
condition_
'
.
$i
;
# override it completely with a numbered label
}
$tablabel
.=
qq{<tr><td port="cond_$i">}
.
(
$condition
?
"
WHEN
$condition
"
:
$choice
?
'
ELSE
'
:
'')
.
"
</td></tr>
";
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment