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
80e8a271
Commit
80e8a271
authored
10 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Patches
Plain Diff
ENSCORESW-1193
: added is_empty method to check if there is genome data available
parent
607d302f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/DBSQL/GenomeContainer.pm
+30
-0
30 additions, 0 deletions
modules/Bio/EnsEMBL/DBSQL/GenomeContainer.pm
modules/t/genomeContainer.t
+8
-0
8 additions, 0 deletions
modules/t/genomeContainer.t
with
38 additions
and
0 deletions
modules/Bio/EnsEMBL/DBSQL/GenomeContainer.pm
+
30
−
0
View file @
80e8a271
...
...
@@ -632,6 +632,36 @@ sub _get_statistic {
return
\
@results
;
}
=head2 is_empty
Arg [1] : none
Example : $results = $genome->is_empty;
Description: Boolean to check if there is data in the genome container
Returntype : Boolean
Exceptions : none
Caller : general
Status : Stable
=cut
sub
is_empty
{
my
$self
=
shift
;
my
$db
=
$self
->
db
;
my
$species_id
=
$self
->
db
->
species_id
();
my
$is_empty
=
0
;
my
$count_sql
=
q{
SELECT count(*) FROM genome_statistics
}
;
my
$sth
=
$self
->
prepare
(
$count_sql
);
$sth
->
execute
();
if
(
$sth
->
fetchrow
())
{
$is_empty
=
1
;
}
$sth
->
finish
();
return
$is_empty
;
}
=head2 get_attrib
Arg [1] : statistic
...
...
This diff is collapsed.
Click to expand it.
modules/t/genomeContainer.t
+
8
−
0
View file @
80e8a271
...
...
@@ -173,6 +173,14 @@ is(0, $empty_genome->has_karyotype, "Empty db does not have chromosomes");
is
(
1
,
$genome
->
is_high_coverage
,
"
Human genebuild is high coverage
");
is
(
0
,
$empty_genome
->
is_high_coverage
,
"
Empty db is not high coverage
");
#
# Test if there is data
#
is
(
1
,
$genome
->
is_empty
,
"
Human core database has genome data
");
is
(
0
,
$empty_genome
->
is_empty
,
"
Empty database has no genome data
");
#
# Test polyploid genome support
#
...
...
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