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

Adding a new method for describing a region's assembly exception type

parent 8a619148
No related branches found
No related tags found
No related merge requests found
......@@ -673,6 +673,34 @@ sub subseq {
return $subseq;
}
=head2 assembly_exception_type
Example : $self->assembly_exception_type();
Description : Returns the type of slice this is. If it is reference then you
will get 'REF' back. Otherwise you will get the first
element from C<get_all_AssemblyExceptionFeatures()>. If no
assembly exception exists you will get an empty string back.
Returntype : String
Exceptions : None
Caller : Public
Status : Beta
=cut
sub assembly_exception_type {
my ($self) = @_;
my $type = q{};
if($self->is_reference()) {
$type = 'REF';
}
else {
my $assembly_exceptions = $self->get_all_AssemblyExceptionFeatures();
if(@{$assembly_exceptions}) {
$type = $assembly_exceptions->[0]->type();
}
}
return $type;
}
=head2 get_base_count
......
use strict;
use warnings;
BEGIN { $| = 1;
use Test;
plan tests => 60;
}
use Test::More tests => 63;
use Bio::EnsEMBL::Test::TestUtils;
......@@ -153,6 +149,8 @@ ok($name eq "chromosome:NCBI33:$CHR:$START:$END:$STRAND");
#
ok($slice->length == ($END-$START + 1));
# Test exception name
is($slice->assembly_exception_type(), 'REF', 'Type of region is REF');
#
# Test get_attributes
......@@ -437,3 +435,11 @@ $slice = $slice_adaptor->fetch_by_region('chromosome', 1, 1, 10);
ok(@alt_names == 1);
$multi->restore();
#Test assembly exception type on HAP
my $hap_slice = $slice_adaptor->fetch_by_region(undef, '20_HAP1');
is($hap_slice->assembly_exception_type(), 'HAP', 'Ensuring haplotype regions are HAP');
my $chr_one_slice = $slice_adaptor->fetch_by_region('chromosome', '1', 1, 10);
is($chr_one_slice->assembly_exception_type(), 'REF', 'Ensuring reference regions are REF');
......@@ -15,3 +15,4 @@
15 _rna_edit RNA editing \N
16 _selenocysteine Selenocysteine \N
17 codon_table Codon Table Alternate codon table
18 non_ref Non Reference Non Reference Sequence Region
\ No newline at end of file
......@@ -13,3 +13,4 @@
469283 14 1
965899 17 2
965888 17 2
469351 18 1
\ No newline at end of file
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