Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
6fd5baf6
Commit
6fd5baf6
authored
12 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Patches
Plain Diff
arrays/hashes updates
parent
03d4a97c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Pipeline/Production/PepStats.pm
+23
-11
23 additions, 11 deletions
modules/Bio/EnsEMBL/Pipeline/Production/PepStats.pm
with
23 additions
and
11 deletions
modules/Bio/EnsEMBL/Pipeline/Production/PepStats.pm
+
23
−
11
View file @
6fd5baf6
...
...
@@ -19,8 +19,8 @@ sub run {
}
my
$helper
=
$dba
->
dbc
()
->
sql_helper
();
my
%
attrib_codes
=
$self
->
get_attrib_codes
();
$self
->
delete_old_attrib
(
$dba
,
%
attrib_codes
);
my
@
attrib_codes
=
$self
->
get_attrib_codes
();
$self
->
delete_old_attrib
(
$dba
,
@
attrib_codes
);
my
$tmpfile
=
$self
->
param
('
tmpdir
')
.
"
/$$.pep
";
$self
->
dump_translation
(
$dba
,
$tmpfile
);
...
...
@@ -39,12 +39,24 @@ sub store_attrib {
my
$prod_dba
=
$self
->
get_production_DBAdaptor
();
my
$prod_helper
=
$prod_dba
->
dbc
()
->
sql_helper
();
my
@attribs
;
my
$sql
=
q{
SELECT name, description
my
$sqlName
=
q{
SELECT name
FROM attrib_type
WHERE code = ? }
;
my
$sqlDesc
=
q{
SELECT description
FROM attrib_type
WHERE code = ? }
;
foreach
my
$key
(
keys
%$results
)
{
my
(
$name
,
$description
)
=
$prod_helper
->
execute
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$key
]);
my
(
$name
,
$description
);
my
@names
=
@
{
$prod_helper
->
execute_simple
(
-
SQL
=>
$sqlName
,
-
PARAMS
=>
[
$key
])
};
foreach
my
$bit
(
@names
)
{
$name
.=
$bit
.
"
";
}
my
@descriptions
=
@
{
$prod_helper
->
execute_simple
(
-
SQL
=>
$sqlDesc
,
-
PARAMS
=>
[
$key
])
};
foreach
my
$bit
(
@descriptions
)
{
$description
.=
$bit
.
"
";
}
my
$value
=
$results
->
{
$key
};
my
$attrib
=
Bio::EnsEMBL::
Attribute
->
new
(
-
NAME
=>
$name
,
...
...
@@ -86,7 +98,7 @@ sub run_pepstats {
sub
delete_old_attrib
{
my
(
$self
,
$dba
,
%
attrib_codes
)
=
@_
;
my
(
$self
,
$dba
,
@
attrib_codes
)
=
@_
;
my
$helper
=
$dba
->
dbc
()
->
sql_helper
();
my
$sql
=
q{
DELETE ta
...
...
@@ -98,8 +110,8 @@ sub delete_old_attrib {
AND s.coord_system_id = c.coord_system_id
AND c.species_id = ?
AND at.code = ? }
;
foreach
my
$
key
(
keys
%
attrib_codes
)
{
$helper
->
execute_update
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$dba
->
species_id
(),
$
key
])
;
foreach
my
$
code
(
@
attrib_codes
)
{
$helper
->
execute_update
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$dba
->
species_id
(),
$
code
])
;
}
}
...
...
@@ -109,11 +121,11 @@ sub get_attrib_codes {
my
$prod_dba
=
$self
->
get_production_DBAdaptor
();
my
$prod_helper
=
$prod_dba
->
dbc
()
->
sql_helper
();
my
$sql
=
q{
SELECT code
, name
SELECT code
FROM attrib_type
WHERE description = 'Pepstats attributes' }
;
my
%
attrib_codes
=
%
{
$prod_helper
->
execute_
into_hash
(
-
SQL
=>
$sql
)
};
return
%
attrib_codes
;
my
@
attrib_codes
=
@
{
$prod_helper
->
execute_
simple
(
-
SQL
=>
$sql
)
};
return
@
attrib_codes
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment