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
6054ecb0
Commit
6054ecb0
authored
Jan 13, 2014
by
Leo Gordon
Browse files
AnalysisDataAdaptor now inherits from NakedTableAdaptor
parent
2c7f73ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
52 deletions
+10
-52
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisDataAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisDataAdaptor.pm
+6
-48
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
+4
-4
No files found.
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisDataAdaptor.pm
View file @
6054ecb0
...
...
@@ -42,62 +42,20 @@ package Bio::EnsEMBL::Hive::DBSQL::AnalysisDataAdaptor;
use
strict
;
use
base
('
Bio::EnsEMBL::DBSQL::
Bas
eAdaptor
');
use
base
('
Bio::EnsEMBL::
Hive::
DBSQL::
NakedTabl
eAdaptor
');
sub
fetch_by_dbID
{
my
(
$self
,
$data_id
)
=
@_
;
my
$sql
=
"
SELECT data FROM analysis_data WHERE analysis_data_id = ?
";
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$data_id
);
my
(
$data
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
();
return
$data
;
}
#
# STORE METHODS
#
################
sub
store
{
my
(
$self
,
$data
)
=
@_
;
return
0
unless
(
$data
);
my
$sth
=
$self
->
prepare
("
INSERT INTO analysis_data (data) VALUES (?)
");
$sth
->
execute
(
$data
);
my
$data_id
=
$self
->
dbc
->
db_handle
->
last_insert_id
(
undef
,
undef
,
'
analysis_data
',
'
analysis_data_id
');
$sth
->
finish
;
return
$data_id
;
sub
default_table_name
{
return
'
analysis_data
';
}
sub
store_if_needed
{
my
(
$self
,
$data
)
=
@_
;
my
$data_id
;
return
0
unless
(
$data
);
my
$sth
=
$self
->
prepare
("
SELECT analysis_data_id FROM analysis_data WHERE data = ?
");
$sth
->
execute
(
$data
);
(
$data_id
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
;
my
(
$self
,
$data
)
=
@_
;
if
(
$data_id
)
{
# print("data already stored as id $data_id\n");
return
$data_id
;
}
my
(
$stored_hash
)
=
$self
->
store
({'
data
'
=>
$data
},
1
);
return
$s
elf
->
store
(
$data
)
;
return
$s
tored_hash
->
{'
analysis_data_id
'}
;
}
1
;
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm
View file @
6054ecb0
...
...
@@ -355,15 +355,15 @@ sub _objs_from_sth {
while
(
$sth
->
fetch
())
{
my
$input_id
=
(
$column
{'
input_id
'}
=~
/^_ext(?:\w+)_data_id (\d+)$/
)
?
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
dbID
(
$
1
)
?
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
analysis_data_id_TO_data
(
$
1
)
:
$column
{'
input_id
'};
my
$param_id_stack
=
(
$column
{'
param_id_stack
'}
=~
/^_ext(?:\w+)_data_id (\d+)$/
)
?
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
dbID
(
$
1
)
?
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
analysis_data_id_TO_data
(
$
1
)
:
$column
{'
param_id_stack
'};
my
$accu_id_stack
=
(
$column
{'
accu_id_stack
'}
=~
/^_ext(?:\w+)_data_id (\d+)$/
)
?
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
dbID
(
$
1
)
?
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
analysis_data_id_TO_data
(
$
1
)
:
$column
{'
accu_id_stack
'};
...
...
@@ -815,7 +815,7 @@ sub fetch_input_ids_for_job_ids {
while
(
my
(
$job_id
,
$input_id
)
=
$sth
->
fetchrow_array
()
)
{
if
(
$input_id
=~
/^_ext(?:\w+)_data_id (\d+)$/
)
{
$input_id
=
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
dbID
(
$
1
);
$input_id
=
$self
->
db
->
get_AnalysisDataAdaptor
->
fetch_by_
analysis_data_id_TO_data
(
$
1
);
}
$input_ids
{
$job_id
*
$id_scale
+
$id_offset
}
=
$input_id
;
}
...
...
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