Commit 10eaf6bf authored by Magali Ruffier's avatar Magali Ruffier
Browse files

is_chromosome uses karyotype rank attribute

parent f2a8cf6b
......@@ -798,10 +798,7 @@ sub assembly_exception_type {
=head2 is_chromosome
Example : print ($slice->is_chromosome()) ? 'I am a chromosome' : 'Not one';
Description : Uses a number of rules known to indicate a chromosome region
other and takes into account those regions which can be
placed on a Chromsome coordinate system but in fact are not
assembled into one.
Description : A chromosome is a slice with a karyotype rank assigned to it.
Returntype : Boolean indicates if the current object is a chromosome
Exceptions : None
......@@ -809,29 +806,8 @@ sub assembly_exception_type {
sub is_chromosome {
my ($self) = @_;
my $coord_system = $self->coord_system->name;
my $seq_name = $self->seq_region_name;
if (($seq_name =~ /random
|^Un\d{4}$
|^Un\.\d{3}\.\d*$
|E\d\d\w*$
|_NT_
|scaffold_
|cutchr
|unplaced
|chunk
|clone
|contig
|genescaffold
|reftig
|supercontig
|ultracontig
/x) or ( $coord_system !~ /^chromosome$/i && $coord_system !~ /^group$/i ) ) {
return 0;
}
return 1;
return $self->has_karyotype();
}
......
......@@ -570,8 +570,8 @@ is($chr_one_slice->assembly_exception_type(), 'REF', 'Ensuring reference regions
# Test slice attributes
my $current_slice = $slice_adaptor->fetch_by_region('chromosome', $CHR, $START, $END);
is($current_slice->is_chromosome, 1, "Slice is a chromosome");
is($current_slice->has_karyotype, 0, "Slice has no karyotype attribute");
is($current_slice->karyotype_rank, 0, "No karyotype rank could be found");
is($current_slice->has_karyotype, 1, "Slice has a karyotype attribute");
is($current_slice->karyotype_rank, 20, "Karyotype rank is 20 could be found");
#
# Test get_genome_component
......
......@@ -16,3 +16,4 @@
16 _selenocysteine Selenocysteine \N
17 codon_table Codon Table Alternate codon table
18 non_ref Non Reference Non Reference Sequence Region
19 karyotype_rank Rank in the karyotype For a given seq_region, if it is part of the species karyotype, will indicate its rank
......@@ -14,3 +14,4 @@
965899 17 2
965888 17 2
469351 18 1
469283 19 20
Markdown is supported
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