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
9c3ae6f2
Commit
9c3ae6f2
authored
Mar 13, 2014
by
Leo Gordon
Browse files
added experimental option -pipeconfig to produce a diagram potentially without a database
parent
425cd656
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
32 deletions
+39
-32
modules/Bio/EnsEMBL/Hive/URLFactory.pm
modules/Bio/EnsEMBL/Hive/URLFactory.pm
+3
-3
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
+9
-11
scripts/generate_graph.pl
scripts/generate_graph.pl
+27
-18
No files found.
modules/Bio/EnsEMBL/Hive/URLFactory.pm
View file @
9c3ae6f2
...
...
@@ -115,7 +115,7 @@ sub fetch {
}
elsif
(
$table_name
eq
'
accu
')
{
return
Bio::EnsEMBL::Hive::
Accumulator
->
new
(
adaptor
=>
$dba
->
get_AccumulatorAdaptor
,
$dba
?
(
adaptor
=>
$dba
->
get_AccumulatorAdaptor
)
:
()
,
struct_name
=>
$tparam_name
,
signature_template
=>
$tparam_value
,
);
...
...
@@ -123,9 +123,9 @@ sub fetch {
}
else
{
return
Bio::EnsEMBL::Hive::
NakedTable
->
new
(
adaptor
=>
$dba
->
get_NakedTableAdaptor
,
$dba
?
(
adaptor
=>
$dba
->
get_NakedTableAdaptor
)
:
()
,
table_name
=>
$table_name
,
$tparam_value
?
(
insertion_method
=>
$tparam_value
)
:
()
$tparam_value
?
(
insertion_method
=>
$tparam_value
)
:
()
,
);
}
}
...
...
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
View file @
9c3ae6f2
...
...
@@ -75,7 +75,7 @@ sub new {
my
$self
=
bless
({},
ref
(
$class
)
||
$class
);
$self
->
dba
(
$hive_dba
);
$self
->
hive_
dba
(
$hive_dba
);
my
$config
=
Bio::EnsEMBL::Hive::Utils::
Config
->
new
(
$config_file_name
?
$config_file_name
:
()
);
$self
->
config
(
$config
);
$self
->
context
(
[
'
Graph
'
]
);
...
...
@@ -104,7 +104,7 @@ sub graph {
}
=head2 dba()
=head2
hive_
dba()
Arg [1] : The DBAdaptor instance
Returntype : DBAdaptor
...
...
@@ -113,14 +113,14 @@ sub graph {
=cut
sub
dba
{
sub
hive_
dba
{
my
$self
=
shift
@_
;
if
(
@
_
)
{
$self
->
{
dba
}
=
shift
@_
;
$self
->
{
'
hive_
dba
'
}
=
shift
@_
;
}
return
$self
->
{
dba
};
return
$self
->
{
'
hive_
dba
'
};
}
...
...
@@ -162,9 +162,7 @@ sub _midpoint_name {
sub
build
{
my
(
$self
)
=
@_
;
my
$hive_dba
=
$self
->
dba
;
Bio::EnsEMBL::
Hive
->
load_collections_from_dba
(
$hive_dba
);
my
$hive_dba
=
$self
->
hive_dba
;
if
(
my
$job_limit
=
$self
->
config_get
('
DisplayJobs
')
and
my
$job_adaptor
=
$hive_dba
&&
$hive_dba
->
get_AnalysisJobAdaptor
)
{
foreach
my
$analysis
(
Bio::EnsEMBL::
Hive
->
collection
('
Analysis
')
->
list
)
{
...
...
@@ -234,7 +232,7 @@ sub build {
push
@
{
$cluster_2_nodes
{
''
}},
_midpoint_name
(
$df_rule
);
# top-level funnels define clusters (top-level "boxes")
}
elsif
(
UNIVERSAL::
isa
(
$df_rule
->
to_analysis
,'
Bio::EnsEMBL::Hive::NakedTable
')
)
{
}
elsif
(
UNIVERSAL::
isa
(
$df_rule
->
to_analysis
,
'
Bio::EnsEMBL::Hive::NakedTable
')
)
{
if
(
my
$funnel
=
$df_rule
->
to_analysis
->
{'
_funnel_dfr
'})
{
push
@
{
$cluster_2_nodes
{
_midpoint_name
(
$funnel
)
}
},
$self
->
_table_node_name
(
$df_rule
);
# table belongs to the same "box" as the dataflow source
...
...
@@ -355,7 +353,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->logic
_name
()
.
'
(
'
.
(
$analysis
->
dbID
||
'
?
')
.
'
)</td></tr>
';
if
(
$display_stats
)
{
$analysis_label
.=
qq{<tr><td colspan="$colspan"> </td></tr>}
;
if
(
$display_stats
eq
'
barchart
')
{
...
...
@@ -517,7 +515,7 @@ sub _add_table_node {
my
$node_fontname
=
$self
->
config_get
('
Node
',
'
Table
',
'
Font
');
my
(
@column_names
,
$columns
,
$table_data
,
$data_limit
,
$hit_limit
);
my
$hive_dba
=
$self
->
dba
;
my
$hive_dba
=
$self
->
hive_
dba
;
if
(
$data_limit
=
$self
->
config_get
('
DisplayData
')
and
my
$naked_table_adaptor
=
$hive_dba
&&
$hive_dba
->
get_NakedTableAdaptor
)
{
$naked_table_adaptor
->
table_name
(
$table_name
);
...
...
scripts/generate_graph.pl
View file @
9c3ae6f2
...
...
@@ -12,10 +12,12 @@ BEGIN {
}
use
Getopt::
Long
;
use
Getopt::
Long
qw(:config pass_through no_auto_abbrev)
;
use
Pod::
Usage
;
use
Bio::EnsEMBL::
Hive
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
',
'
load_file_or_module
');
use
Bio::EnsEMBL::Hive::Utils::
Graph
;
main
();
...
...
@@ -33,8 +35,10 @@ sub main {
'
reg_alias|reg_name=s
'
=>
\
$self
->
{'
reg_alias
'},
'
nosqlvc=i
'
=>
\
$self
->
{'
nosqlvc
'},
# using "=i" instead of "!" for consistency with scripts where it is a propagated option
'
pipeconfig|pc=s
'
=>
\
$self
->
{'
pipeconfig
'},
'
f|format=s
'
=>
\
$self
->
{'
format
'},
'
o|output=s
'
=>
\
$self
->
{'
output
'},
'
o|
out|
output=s
'
=>
\
$self
->
{'
output
'},
'
h|help
'
=>
\
$self
->
{'
help
'},
);
...
...
@@ -43,22 +47,6 @@ sub main {
pod2usage
({
-
exitvalue
=>
0
,
-
verbose
=>
2
});
}
if
(
$self
->
{'
url
'}
or
$self
->
{'
reg_alias
'})
{
$self
->
{'
dba
'}
=
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
->
new
(
-
url
=>
$self
->
{'
url
'},
-
reg_conf
=>
$self
->
{'
reg_conf
'},
-
reg_type
=>
$self
->
{'
reg_type
'},
-
reg_alias
=>
$self
->
{'
reg_alias
'},
-
no_sql_schema_version_check
=>
$self
->
{'
nosqlvc
'},
);
}
else
{
pod2usage
({
-
message
=>
'
ERROR: Connection parameters (url or reg_conf+reg_alias) need to be specified
',
-
exitvalue
=>
1
,
-
verbose
=>
2
});
}
if
(
!
$self
->
{'
output
'})
{
pod2usage
({
-
message
=>
'
ERROR: No -output flag given
',
...
...
@@ -75,6 +63,27 @@ sub main {
}
}
if
(
$self
->
{'
url
'}
or
$self
->
{'
reg_alias
'})
{
$self
->
{'
dba
'}
=
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
->
new
(
-
url
=>
$self
->
{'
url
'},
-
reg_conf
=>
$self
->
{'
reg_conf
'},
-
reg_type
=>
$self
->
{'
reg_type
'},
-
reg_alias
=>
$self
->
{'
reg_alias
'},
-
no_sql_schema_version_check
=>
$self
->
{'
nosqlvc
'},
);
Bio::EnsEMBL::
Hive
->
load_collections_from_dba
(
$self
->
{'
dba
'}
);
}
if
(
$self
->
{'
pipeconfig
'})
{
my
$pipeconfig_package_name
=
load_file_or_module
(
$self
->
{'
pipeconfig
'}
);
my
$pipeconfig_object
=
$pipeconfig_package_name
->
new
();
$pipeconfig_object
->
process_options
();
$pipeconfig_object
->
add_objects_from_config
();
}
my
$graph
=
Bio::EnsEMBL::Hive::Utils::
Graph
->
new
(
$self
->
{'
dba
'}
);
my
$graphviz
=
$graph
->
build
();
...
...
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