Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
10eaf6bf
Commit
10eaf6bf
authored
Nov 12, 2015
by
Magali Ruffier
Browse files
is_chromosome uses karyotype rank attribute
parent
f2a8cf6b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
29 deletions
+7
-29
modules/Bio/EnsEMBL/Slice.pm
modules/Bio/EnsEMBL/Slice.pm
+3
-27
modules/t/slice.t
modules/t/slice.t
+2
-2
modules/t/test-genome-DBs/homo_sapiens/core/attrib_type.txt
modules/t/test-genome-DBs/homo_sapiens/core/attrib_type.txt
+1
-0
modules/t/test-genome-DBs/homo_sapiens/core/seq_region_attrib.txt
...t/test-genome-DBs/homo_sapiens/core/seq_region_attrib.txt
+1
-0
No files found.
modules/Bio/EnsEMBL/Slice.pm
View file @
10eaf6bf
...
...
@@ -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
();
}
...
...
modules/t/slice.t
View file @
10eaf6bf
...
...
@@ -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 k
aryotype rank could be found
");
is
(
$current_slice
->
has_karyotype
,
1
,
"
Slice has
a
karyotype attribute
");
is
(
$current_slice
->
karyotype_rank
,
2
0
,
"
K
aryotype rank
is 20
could be found
");
#
# Test get_genome_component
...
...
modules/t/test-genome-DBs/homo_sapiens/core/attrib_type.txt
View file @
10eaf6bf
...
...
@@ -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
modules/t/test-genome-DBs/homo_sapiens/core/seq_region_attrib.txt
View file @
10eaf6bf
...
...
@@ -14,3 +14,4 @@
965899 17 2
965888 17 2
469351 18 1
469283 19 20
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment