Skip to content
Snippets Groups Projects
Commit e148443a authored by Magali Ruffier's avatar Magali Ruffier
Browse files

ENSCORESW-1120: added is_high_coverage flag for genome container

parent f5421889
No related branches found
No related tags found
No related merge requests found
......@@ -1189,6 +1189,39 @@ sub has_karyotype {
return 1;
}
=head2 is_high_coverage
Arg : None
Example : $is_high_coverage = $genome->is_high_coverage();
Description: Boolean indicating whether an assembly is high coverage
or not
Returntype : integer
Exceptions : none
Caller : general
Status : Stable
=cut
sub is_high_coverage {
my $self = shift;
my $coverage_depth = $self->_meta_container->single_value_by_key('assembly.coverage_depth');
return 0 if !$coverage_depth;
$coverage_depth = lc($coverage_depth);
if ($coverage_depth eq 'high') {
return 1;
} elsif (($coverage_depth eq 'low') or ($coverage_depth eq 'medium')) {
return 0;
} elsif ($coverage_depth =~ /^([0-9]+)x$/) {
return $1<6 ? 0 : 1;
}
return 0;
}
=head2 is_polyploid
Arg : None
......
......@@ -15,6 +15,7 @@
use strict;
use warnings;
use Test::Warnings;
use Bio::EnsEMBL::DBSQL::GenomeContainer;
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Registry;
......@@ -154,15 +155,24 @@ my $alt_transcript_count = $sql_helper->execute_single_result(-SQL => $alt_trans
is($alt_transcript_count, $genome->get_alt_transcript_count(), "Number of alt transcripts is correct");
#
#
# Test karyotype flag
#
is(1, $genome->has_karyotype, "Human has some chromosomes");
my $empty_db = $multi->get_DBAdaptor("empty");
my $empty_genome = $empty_db->get_adaptor('GenomeContainer');
is(1, $genome->has_karyotype, "Human has some chromosomes");
is(0, $empty_genome->has_karyotype, "Empty db does not have chromosomes");
#
# Test high coverage flag
#
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 polyploid genome support
#
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment