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

ENSCORESW-1120: new method to check if a genome has a karyotype (ie chromosomes)

parent 24d38fdb
No related branches found
No related tags found
No related merge requests found
......@@ -1163,6 +1163,32 @@ sub get_alt_transcript_count {
return $self->{'alt_transcript_count'};
}
=head2 has_karyotype
Arg : None
Example : $has_karyotype = $genome->has_karyotype();
Description: Boolean indicating whether a genome has a karyotype (ie chromosomes)
or not
Returntype : integer
Exceptions : none
Caller : general
Status : Stable
=cut
sub has_karyotype {
my $self = shift;
my $db = $self->db();
my $slice_adaptor = $db->get_SliceAdaptor();
my $karyotype = $slice_adaptor->fetch_all_karyotype;
return 0 unless scalar(@$karyotype);
return 1;
}
=head2 is_polyploid
Arg : None
......
......@@ -153,6 +153,16 @@ and biotype not in ('LRG_gene')";
my $alt_transcript_count = $sql_helper->execute_single_result(-SQL => $alt_transcript_sql);
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(0, $empty_genome->has_karyotype, "Empty db does not have chromosomes");
#
# 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