Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
7976b564
Commit
7976b564
authored
Nov 16, 2015
by
Magali Ruffier
Browse files
more tests for untested methods
parent
5fb74911
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
20 deletions
+41
-20
modules/t/sliceAdaptor.t
modules/t/sliceAdaptor.t
+41
-20
No files found.
modules/t/sliceAdaptor.t
View file @
7976b564
...
...
@@ -75,26 +75,6 @@ my $seq2 = $contig->seq();
ok
(
$seq1
eq
$seq2
);
#
# 12-13 fetch_by_fpc_name
#
#my $fpc_name = 'NT_011387';
#$slice = $slice_adaptor->fetch_by_supercontig_name($fpc_name);
#ok($new_slice->chr_start);
#ok($new_slice->chr_end);
#
# 14 - 15 fetch_by_clone_accession
#
#my $clone_acc = 'AL031658';
#$slice = $slice_adaptor->fetch_by_clone_accession($clone_acc);
#$new_slice = $slice_adaptor->fetch_by_clone_accession($clone_acc, $FLANKING);
#ok($new_slice->chr_start == $slice->chr_start - $FLANKING);
#ok($new_slice->chr_end == $slice->chr_end + $FLANKING);
#
# 16-17 fetch by transcript_stable_id
#
...
...
@@ -107,6 +87,17 @@ ok($new_slice->start == $slice->start - $FLANKING);
ok
(
$new_slice
->
end
==
$slice
->
end
+
$FLANKING
);
#
# fetch_by_exon_stable_id
#
my
$e_stable_id
=
'
ENSE00001048794
';
$slice
=
$slice_adaptor
->
fetch_by_exon_stable_id
(
$e_stable_id
);
$new_slice
=
$slice_adaptor
->
fetch_by_exon_stable_id
(
$e_stable_id
,
$FLANKING
);
ok
(
$new_slice
->
start
==
$slice
->
start
-
$FLANKING
);
ok
(
$new_slice
->
end
==
$slice
->
end
+
$FLANKING
);
#
# 18-19 fetch by transcript_id
#
...
...
@@ -320,8 +311,10 @@ ok($updated_slice->seq_region_length() == $chr_len);
ok
(
$updated_slice
->
seq_region_name
eq
$name
);
#
# Store an assembly between the slices
# Retrieve and remove said assembly
#
my
$asm_start
=
9999
;
my
$asm_slice
=
$chr_slice
->
sub_Slice
(
$asm_start
,
$asm_start
+
$ctg_len
-
1
);
...
...
@@ -330,6 +323,14 @@ my $str = $slice_adaptor->store_assembly( $asm_slice, $ctg_slice );
ok
(
$str
eq
"
chromosome:NCBI33:testregion2:9999:10048:1<>
"
.
"
contig::testregion:1:50:1
"
);
my
$new_mapper
=
$slice_adaptor
->
fetch_assembly
(
$asm_slice
,
$ctg_slice
);
is
(
$new_mapper
->
from
->
name
,
'
chromosome:NCBI33:testregion2:9999:10048:1
',
'
Mapping from chromosome
');
is
(
$new_mapper
->
to
->
name
,
'
contig::testregion:1:50:1
',
'
Mapping to contig
');
$slice_adaptor
->
remove_assembly
(
$asm_slice
,
$ctg_slice
);
my
$empty_mapper
=
$slice_adaptor
->
fetch_assembly
(
$asm_slice
,
$ctg_slice
);
is
(
$empty_mapper
,
undef
,
'
Mapper has been removed
');
my
$ctg_map
=
$chr_slice
->
project
(
$ctg_cs
->
name
,
$ctg_cs
->
version
);
# Test currently fails as assembly cached somewhere.
#ok( @$ctg_map == 1 and
...
...
@@ -661,6 +662,26 @@ ok(!defined $slice_adaptor->fetch_by_toplevel_location('1:-100--50', 1), 'Checki
ok
(
!
defined
$strand
,
'
Strand is undefined
');
}
## Test patch data
my
$patch_db
=
$multi
->
get_DBAdaptor
('
patch
');
$slice_adaptor
=
$patch_db
->
get_SliceAdaptor
();
my
$unique_slices
=
$slice_adaptor
->
fetch_by_region_unique
("
chromosome
",
"
HG1304_PATCH
");
my
$unique_slice
=
$unique_slices
->
[
0
];
my
$initial_slice
=
$slice_adaptor
->
fetch_by_region
("
chromosome
",
"
HG1304_PATCH
");
my
$exceptions
=
$initial_slice
->
get_all_AssemblyExceptionFeatures
();
is
(
$unique_slice
->
start
,
$exceptions
->
[
0
]
->
start
,
"
Start of patch
");
is
(
$unique_slice
->
end
,
$exceptions
->
[
0
]
->
end
,
"
End of patch
");
## Test karyotype data
my
$band_slice
=
$slice_adaptor
->
fetch_by_chr_band
('
6
',
'
p21.33
');
is
(
$band_slice
->
seq_region_name
,
'
6
',
'
Fetched chromosome 6
');
############# METHODS BELOW HERE
sub
test_toplevel_location
{
...
...
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