Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
29fe0be2
Commit
29fe0be2
authored
Feb 28, 2014
by
Leo Gordon
Browse files
pre-fetch all analyses into $all_analyses_coll to check against in analysis_topup mode
parent
b11320f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
modules/Bio/EnsEMBL/Hive/PipeConfig/HiveGeneric_conf.pm
modules/Bio/EnsEMBL/Hive/PipeConfig/HiveGeneric_conf.pm
+9
-7
No files found.
modules/Bio/EnsEMBL/Hive/PipeConfig/HiveGeneric_conf.pm
View file @
29fe0be2
...
...
@@ -517,7 +517,7 @@ sub run {
my
$valley
=
Bio::EnsEMBL::Hive::
Valley
->
new
(
{},
'
LOCAL
'
);
my
$all_analyses_coll
=
Bio::EnsEMBL::Hive::Utils::
Collection
->
new
(
);
my
$all_analyses_coll
=
Bio::EnsEMBL::Hive::Utils::
Collection
->
new
(
$analysis_adaptor
->
fetch_all
);
# load all previously stored analyses for analysis_topup
my
%seen_logic_name
=
();
...
...
@@ -535,7 +535,7 @@ sub run {
die
"
an entry with logic_name '
$logic_name
' appears at least twice in the configuration file, can't continue
";
}
my
$analysis
=
$analys
i
s_
adaptor
->
fetch
_by
_
logic_name
(
$logic_name
);
my
$analysis
=
$
all_
analys
e
s_
coll
->
find_one
_by
('
logic_name
',
$logic_name
);
# the analysis with this logic_name may have already been stored in the db
if
(
$analysis
)
{
if
(
$analysis_topup
)
{
...
...
@@ -621,7 +621,7 @@ sub run {
my
(
$logic_name
,
$wait_for
,
$flow_into
)
=
@
{
$aha
}{
qw(-logic_name -wait_for -flow_into)
};
# slicing a hash reference
my
$analysis
=
$all_analyses_coll
->
find_one_by
('
logic_name
',
$logic_name
);
# TODO: make sure it works for pre-stored analyses ("analysis_topup")
my
$analysis
=
$all_analyses_coll
->
find_one_by
('
logic_name
',
$logic_name
);
$wait_for
||=
[]
;
$wait_for
=
[
$wait_for
]
unless
(
ref
(
$wait_for
)
eq
'
ARRAY
');
# force scalar into an arrayref
...
...
@@ -630,7 +630,7 @@ sub run {
foreach
my
$condition_url
(
@$wait_for
)
{
unless
(
$condition_url
=~
m{^\w*://}
)
{
my
$condition_analysis
=
$all_analyses_coll
->
find_one_by
('
logic_name
',
$condition_url
)
or
die
"
Could not f
etch
analysis '
$condition_url
' to create a control rule (in '
"
.
(
$analysis
->
logic_name
)
.
"
')
\n
";
or
die
"
Could not f
ind a local
analysis '
$condition_url
' to create a control rule (in '
"
.
(
$analysis
->
logic_name
)
.
"
')
\n
";
}
my
$c_rule
=
Bio::EnsEMBL::Hive::
AnalysisCtrlRule
->
new
(
'
condition_analysis_url
'
=>
$condition_url
,
...
...
@@ -679,7 +679,7 @@ sub run {
unless
(
$heir_url
=~
m{^\w*://}
)
{
my
$heir_analysis
=
$all_analyses_coll
->
find_one_by
('
logic_name
',
$heir_url
)
or
die
"
No
analysis named '
$heir_url
' (dataflow from analysis '
"
.
(
$analysis
->
logic_name
)
.
"
')
\n
";
or
die
"
Could not find a local
analysis named '
$heir_url
' (dataflow from analysis '
"
.
(
$analysis
->
logic_name
)
.
"
')
\n
";
}
$input_id_template_list
=
[
$input_id_template_list
]
unless
(
ref
(
$input_id_template_list
)
eq
'
ARRAY
');
# allow for more than one template per analysis
...
...
@@ -717,8 +717,10 @@ sub run {
foreach
my
$analysis
(
$all_analyses_coll
->
list
)
{
my
$stats
=
$analysis
->
stats
;
# should be taking the value cached previously
$analysis_adaptor
->
store
(
$analysis
);
$analysis_stats_adaptor
->
store
(
$stats
);
unless
(
$analysis
->
adaptor
)
{
# TODO: check a more thorough condition if moving analyses around, etc
$analysis_adaptor
->
store
(
$analysis
);
$analysis_stats_adaptor
->
store
(
$stats
);
}
if
(
my
$our_jobs
=
$analysis
->
jobs_collection
)
{
$job_adaptor
->
store_jobs_and_adjust_counters
(
$our_jobs
);
...
...
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