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
a1fa4ae0
Commit
a1fa4ae0
authored
Mar 18, 2014
by
Leo Gordon
Browse files
properly display foreign analyses (ctrl sources and dataflow targets) on the diagram
parent
381d510f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
modules/Bio/EnsEMBL/Hive/Analysis.pm
modules/Bio/EnsEMBL/Hive/Analysis.pm
+6
-7
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
+16
-3
No files found.
modules/Bio/EnsEMBL/Hive/Analysis.pm
View file @
a1fa4ae0
...
...
@@ -170,22 +170,21 @@ sub process {
=cut
sub
url
{
my
$self
=
shift
;
return
undef
unless
(
$self
->
adaptor
);
my
(
$self
,
$ref_dba
)
=
@_
;
# if reference dba is the same as 'our' dba, a shorter url is generated
return
$self
->
adaptor
->
db
->
dbc
->
url
.
'
/analysis?logic_name=
'
.
$self
->
logic_name
;
my
$adaptor
=
$self
->
adaptor
;
return
(
(
$adaptor
and
$adaptor
->
db
ne
(
$ref_dba
//
'')
)
?
$adaptor
->
db
->
dbc
->
url
.
'
/analysis?logic_name=
'
:
'')
.
$self
->
logic_name
;
}
sub
display_name
{
my
(
$self
,
$ref_dba
)
=
@_
;
my
(
$self
,
$ref_dba
)
=
@_
;
# if reference dba is the same as 'our' dba, a shorter display_name is generated
return
(
$self
->
adaptor
and
$self
->
adaptor
->
db
ne
(
$ref_dba
//
'')
)
?
$self
->
adaptor
->
db
->
dbc
->
dbname
.
'
/
'
.
$self
->
logic_name
:
$self
->
logic_name
;
my
$adaptor
=
$self
->
adaptor
;
return
(
$adaptor
and
$adaptor
->
db
ne
(
$ref_dba
//
'')
)
?
$adaptor
->
db
->
dbc
->
dbname
.
'
/
'
.
$self
->
logic_name
:
$self
->
logic_name
;
}
=head2 stats
Arg [1] : none
...
...
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
View file @
a1fa4ae0
...
...
@@ -182,17 +182,29 @@ sub build {
if
(
UNIVERSAL::
isa
(
$target_object
,
'
Bio::EnsEMBL::Hive::Analysis
'))
{
$target_object
->
{'
_inflow_count
'}
++
;
}
}
# otherwise it may be a link out (unsupported at the moment)
}
elsif
(
$df_rule
->
to_analysis
->
isa
('
Bio::EnsEMBL::Hive::Analysis
')
)
{
# dataflow target is a foreign Analysis
$target_object
=
$df_rule
->
to_analysis
();
$target_object
->
{'
_foreign
'}
=
1
;
Bio::EnsEMBL::
Hive
->
collection
('
Analysis
')
->
add
(
$target_object
);
# add it to the collection
}
if
(
my
$funnel_dataflow_rule
=
$df_rule
->
funnel_dataflow_rule
)
{
$funnel_dataflow_rule
->
{'
_is_a_funnel
'}
++
;
}
}
foreach
my
$c_rule
(
Bio::EnsEMBL::
Hive
->
collection
('
AnalysisCtrlRule
')
->
list
)
{
# control rule's condition is a foreign Analysis
unless
(
Bio::EnsEMBL::
Hive
->
collection
('
Analysis
')
->
find_one_by
('
logic_name
',
$c_rule
->
condition_analysis_url
))
{
my
$condition_analysis
=
$c_rule
->
condition_analysis
();
$condition_analysis
->
{'
_foreign
'}
=
1
;
Bio::EnsEMBL::
Hive
->
collection
('
Analysis
')
->
add
(
$condition_analysis
);
# add it to the collection
}
}
# NB: this is a very approximate algorithm with rough edges!
# It will not find all start nodes in cyclic components!
foreach
my
$source_analysis
(
Bio::EnsEMBL::
Hive
->
collection
('
Analysis
')
->
list
)
{
unless
(
$source_analysis
->
{'
_inflow_count
'}
)
{
# if there is no dataflow into this analysis
unless
(
$source_analysis
->
{'
_inflow_count
'}
or
$source_analysis
->
{'
_foreign
'}
)
{
# if there is no dataflow into this analysis
# run the recursion in each component that has a non-cyclic start:
$self
->
_propagate_allocation
(
$source_analysis
);
}
...
...
@@ -339,6 +351,7 @@ sub _add_analysis_node {
my
$style
=
$analysis
->
can_be_empty
()
?
'
dashed, filled
'
:
'
filled
'
;
my
$node_fontname
=
$self
->
config_get
('
Node
',
'
AnalysisStatus
',
$analysis_status
,
'
Font
');
my
$display_stats
=
$self
->
config_get
('
DisplayStats
');
my
$hive_dba
=
$self
->
hive_dba
;
my
$colspan
=
0
;
my
$bar_chart
=
'';
...
...
@@ -357,7 +370,7 @@ sub _add_analysis_node {
}
$colspan ||= 1;
my $analysis_label =
'
<<
table
border
=
"
0
"
cellborder
=
"
0
"
cellspacing
=
"
0
"
cellpadding
=
"
1
"
><
tr><td colspan="'.$colspan.'">'.$analysis->
logic
_name
(
)
.
'
(
'
.
(
$analysis
->
dbID
||
'
?
')
.
'
)</td></tr>
';
my $analysis_label =
'
<<
table
border
=
"
0
"
cellborder
=
"
0
"
cellspacing
=
"
0
"
cellpadding
=
"
1
"
><
tr><td colspan="'.$colspan.'">'.$analysis->
displa
y_name
(
$hive_dba
)
.
'
(
'
.
(
$analysis
->
dbID
||
'
?
')
.
'
)</td></tr>
';
if
(
$display_stats
)
{
$analysis_label
.=
qq{<tr><td colspan="$colspan"> </td></tr>}
;
if
(
$display_stats
eq
'
barchart
')
{
...
...
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