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
de129fbc
Commit
de129fbc
authored
12 years ago
by
Dan Staines
Browse files
Options
Downloads
Patches
Plain Diff
Improved speed of DensityGenerator by using new count methods
parent
592395b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Pipeline/Production/DensityGenerator.pm
+13
-9
13 additions, 9 deletions
modules/Bio/EnsEMBL/Pipeline/Production/DensityGenerator.pm
with
13 additions
and
9 deletions
modules/Bio/EnsEMBL/Pipeline/Production/DensityGenerator.pm
+
13
−
9
View file @
de129fbc
...
...
@@ -67,7 +67,10 @@ sub run {
last
;
}
}
## end while (my $slice = shift ...)
$dfa
->
store
(
@features
);
if
(
scalar
(
@features
)
>
0
)
{
$dfa
->
store
(
@features
);
}
return
;
}
## end sub run
## Creating density type for fixed number of blocks
...
...
@@ -133,7 +136,8 @@ sub delete_old_features {
AND cs.species_id = ? AND a.analysis_id = dt.analysis_id
AND dt.density_type_id = df.density_type_id
AND a.logic_name = ? }
;
$helper
->
execute_update
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$dba
->
species_id
(),
$logic_name
]);
$helper
->
execute_update
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$dba
->
species_id
(),
$logic_name
]);
}
## Checks if the analysis already exists in the database
...
...
@@ -163,7 +167,9 @@ sub get_analysis {
SELECT distinct display_label, description
FROM analysis_description
WHERE is_current = 1 and logic_name = ? }
;
my
(
$display_label
,
$description
)
=
@
{
$helper
->
execute
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$logic_name
])
->
[
0
]};
my
$anals
=
$helper
->
execute
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[
$logic_name
])
->
[
0
];
throw
"
Could not find analysis
$logic_name
"
unless
(
defined
$anals
);
my
(
$display_label
,
$description
)
=
@
{
$anals
};
my
$analysis
=
new
Bio::EnsEMBL::
Analysis
(
-
logic_name
=>
$logic_name
,
-
display_label
=>
$display_label
,
-
description
=>
$description
,
...
...
@@ -193,18 +199,16 @@ sub get_option {
sub
get_density
{
my
(
$self
,
$block
,
$biotypes
)
=
@_
;
my
$count
=
0
;
foreach
my
$biotype
(
@$biotypes
)
{
$count
+=
scalar
(
@
{
$block
->
get_all_Genes_by_type
(
$biotype
)});
}
return
$count
;
my
$species
=
$self
->
param
('
species
');
my
$ga
=
Bio::EnsEMBL::
Registry
->
get_adaptor
(
$species
,
'
core
',
'
gene
');
return
$ga
->
count_all_by_Slice
(
$block
,
$biotypes
);
}
sub
get_total
{
my
(
$self
,
$option
)
=
@_
;
my
$species
=
$self
->
param
('
species
');
my
$ga
=
Bio::EnsEMBL::
Registry
->
get_adaptor
(
$species
,
'
core
',
'
gene
');
return
scalar
(
@
{
$ga
->
fetch
_all_by_biotype
(
$option
)
})
;
return
$ga
->
count
_all_by_biotype
(
$option
);
}
1
;
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