Skip to content
Snippets Groups Projects
Commit 89d58f6c authored by Andy Yates's avatar Andy Yates
Browse files

Adding the method is_chromosome to the Slice object. This kind of method is...

Adding the method is_chromosome to the Slice object. This kind of method is not nice but does deal with a lot of issues with seq_regions being attached to chromosome coordinate systems which are infact unassembled regions.
parent d6247124
No related branches found
No related tags found
No related merge requests found
......@@ -692,6 +692,46 @@ sub assembly_exception_type {
return $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.
Returntype : Boolean indicates if the current object is a chromosome
Exceptions : None
=cut
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
|group
|reftig
|supercontig
|ultracontig
/x) or ( $coord_system !~ /^chromosome$/i )) {
return 0;
}
return 1;
}
=head2 get_base_count
......
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