Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
62f57728
Commit
62f57728
authored
11 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Patches
Plain Diff
updated to use patch test database
now fully testing patches and haplotypes
parent
269d5c19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/t/assemblyException.t
+22
-27
22 additions, 27 deletions
modules/t/assemblyException.t
modules/t/assemblyExceptionFeature.t
+29
-4
29 additions, 4 deletions
modules/t/assemblyExceptionFeature.t
with
51 additions
and
31 deletions
modules/t/assemblyException.t
+
22
−
27
View file @
62f57728
...
...
@@ -12,31 +12,27 @@ our $verbose = 0;
my
$multi
=
Bio::EnsEMBL::Test::
MultiTestDB
->
new
();
ok
(
1
);
my
$db
=
$multi
->
get_DBAdaptor
('
core
');
my
$db
=
$multi
->
get_DBAdaptor
('
patch
');
my
$sfa
=
$db
->
get_SimpleFeatureAdaptor
();
my
$aexc_adaptor
=
$db
->
get_AssemblyExceptionFeatureAdaptor
();
my
$slice_adaptor
=
$db
->
get_SliceAdaptor
();
##chromosome Y is a fake 'PAR' linked to chromosome 20
my
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
Y
',
8e6
,
13e6
);
my
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
Y
',
1
,
400000
);
my
$feats
=
$sfa
->
fetch_all_by_Slice
(
$slice
);
debug
("
Got
"
.
scalar
(
@$feats
));
ok
(
@$feats
==
58
);
is
(
@$feats
,
94
,
"
Returned 58 features
"
);
print_features
(
$feats
);
#HAP_1 is a fake haplotype on chromosome 20
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
20_HAP1
',
30_399_998
,
30_600_002
);
my
$org_slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
20
',
30_430_000
,
30_500_000
);
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
Y
',
1
,
200000
);
my
$org_slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
X
',
1
,
200000
);
$feats
=
$sfa
->
fetch_all_by_Slice
(
$slice
);
debug
("
Got
"
.
scalar
(
@$feats
));
is
(
@$feats
,
9
,
"
Fetched 9 features
");
is
(
@$feats
,
24
,
"
Fetched 24 features
");
print_features
(
$feats
);
...
...
@@ -56,13 +52,13 @@ for my $f ( @$feats ) {
}
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
20_HAP1
',
30_400_000
,
30_600_
000
);
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
Y
',
1
,
200
000
);
$feats
=
$sfa
->
fetch_all_by_Slice
(
$slice
);
debug
(
"
After storing retrieval
"
);
print_features
(
$feats
);
is
(
@$feats
,
1
4
,
"
Fetched
1
4 features
");
is
(
@$feats
,
2
4
,
"
Fetched
2
4 features
");
...
...
@@ -70,28 +66,27 @@ is(@$feats, 14, "Fetched 14 features");
# sequence getting tests
#
my
$hap_slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
20_HAP1
',
30_400_000
,
30_7
00
_
000
);
my
$hap_slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
Y
',
10001
,
4
00000
);
$org_slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
20
',
30_400_000
,
30_8
00
_
000
);
$org_slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
X
',
60001
,
4
00000
);
my
(
$fhs
,
$bhs
,
$fos
,
$bos
);
debug
(
"
Front hap seq:
"
.
(
$fhs
=
$hap_slice
->
subseq
(
99_991
,
100_000
)));
debug
(
"
Back hap seq:
"
.
(
$bhs
=
$hap_slice
->
subseq
(
2
00_001
,
2
00_010
)));
debug
(
"
Back hap seq:
"
.
(
$bhs
=
$hap_slice
->
subseq
(
4
00_001
,
4
00_010
)));
debug
(
"
Front org seq:
"
.
(
$fos
=
$org_slice
->
subseq
(
99_991
,
100_000
)));
debug
(
"
Back org seq:
"
.
(
$bos
=
$org_slice
->
subseq
(
3
00_001
,
3
00_010
)));
debug
(
"
Back org seq:
"
.
(
$bos
=
$org_slice
->
subseq
(
4
00_001
,
4
00_010
)));
ok
(
$fhs
eq
$fos
);
ok
(
$bhs
eq
$bos
);
is
(
$fhs
,
$fos
,
"
Front sequences for haplotype and reference are the same
"
);
is
(
$bhs
,
$bos
,
"
Back sequences for haplotype and reference are the same
"
);
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
20_HAP1
',
30_4
99_998
,
3
0_5
00_002
);
$slice
=
$slice_adaptor
->
fetch_by_region
('
chromosome
',
'
Y
',
2
99_998
,
300_002
);
debug
(
$slice
->
seq
);
is
(
$slice
->
seq
(),
"
GTNNN
",
"
Fetched haplotype subslice
");
is
(
$slice
->
seq
(),
"
ACAGA
",
"
Fetched haplotype subslice
");
$multi
->
restore
();
...
...
This diff is collapsed.
Click to expand it.
modules/t/assemblyExceptionFeature.t
+
29
−
4
View file @
62f57728
...
...
@@ -13,7 +13,7 @@ my $multi = Bio::EnsEMBL::Test::MultiTestDB->new;
# get a core DBAdaptor
#
my
$dba
=
$multi
->
get_DBAdaptor
("
core
");
my
$dba
=
$multi
->
get_DBAdaptor
("
patch
");
my
$aefa
=
$dba
->
get_AssemblyExceptionFeatureAdaptor
();
ok
(
$aefa
);
...
...
@@ -42,10 +42,19 @@ is(ref($aef->adaptor), 'Bio::EnsEMBL::DBSQL::AssemblyExceptionFeatureAdaptor', "
# fetch all
my
$chr_slice
=
$dba
->
get_SliceAdaptor
->
fetch_by_region
('
chromosome
',
'
20_HAP1
');
'
Y
');
my
$ref_slice
=
$dba
->
get_SliceAdaptor
->
fetch_by_region
('
chromosome
',
'
6
');
my
$patch_slice
=
$dba
->
get_SliceAdaptor
->
fetch_by_region
('
supercontig
',
'
HG1304_PATCH
');
my
@features
=
@
{
$aefa
->
fetch_all_by_Slice
(
$chr_slice
)};
is
(
@features
,
1
,
"
Fetched one assembly exception feature for 20_HAP1
");
is
(
@features
,
2
,
"
Fetched one assembly exception feature for Y
");
my
@ref_features
=
@
{
$aefa
->
fetch_all_by_Slice
(
$ref_slice
)};
is
(
@ref_features
,
1
,
"
Fetched one assembly exception features for chromosome 6
");
my
@patch_features
=
@
{
$aefa
->
fetch_all_by_Slice
(
$patch_slice
)
};
is
(
@patch_features
,
1
,
"
Fetched one assembly exception for HG1304_PATCH
");
foreach
my
$f
(
@features
)
{
debug
(
"
Feature:
"
.
$f
->
slice
->
seq_region_name
.
"
"
.
...
...
@@ -55,6 +64,22 @@ foreach my $f (@features) {
$as
->
start
.
"
"
.
$as
->
end
);
}
foreach
my
$f
(
@ref_features
)
{
debug
(
"
Feature:
"
.
$f
->
slice
->
seq_region_name
.
"
"
.
$f
->
start
.
"
"
.
$f
->
end
.
"
"
.
$f
->
type
);
my
$as
=
$f
->
alternate_slice
();
debug
("
Alternate slice:
"
.
$as
->
seq_region_name
.
"
"
.
$as
->
start
.
"
"
.
$as
->
end
);
}
foreach
my
$f
(
@patch_features
)
{
debug
(
"
Feature:
"
.
$f
->
slice
->
seq_region_name
.
"
"
.
$f
->
start
.
"
"
.
$f
->
end
.
"
"
.
$f
->
type
);
my
$as
=
$f
->
alternate_slice
();
debug
("
Alternate slice:
"
.
$as
->
seq_region_name
.
"
"
.
$as
->
start
.
"
"
.
$as
->
end
);
}
my
(
$f
)
=
@features
;
is
(
$f
->
display_id
,
$f
->
alternate_slice
->
seq_region_name
,
"
Feature display id matches feature's alternate slice name
");
...
...
@@ -67,7 +92,7 @@ is($feat->dbID(), 1, "Feature dbID is 1");
my
$aef_store
=
new
Bio::EnsEMBL::
AssemblyExceptionFeature
();
my
$aef_store2
=
new
Bio::EnsEMBL::
AssemblyExceptionFeature
();
#get ref slice
my
$ref_slice
=
$dba
->
get_SliceAdaptor
->
fetch_by_region
('
chromosome
',
20
);
my
$ref_slice
=
$dba
->
get_SliceAdaptor
->
fetch_by_region
('
chromosome
',
6
);
#prepare first object, the haplotype
$aef_store
->
start
(
1500
);
$aef_store
->
end
(
35000
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment