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
9aacf50b
Commit
9aacf50b
authored
20 years ago
by
Arne Stabenau
Browse files
Options
Downloads
Patches
Plain Diff
written tests for affy features, now write classes to make them pass
parent
710635c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/t/affy.t
+151
-0
151 additions, 0 deletions
modules/t/affy.t
with
151 additions
and
0 deletions
modules/t/affy.t
0 → 100644
+
151
−
0
View file @
9aacf50b
use
strict
;
use
warnings
;
use
Bio::EnsEMBL::
Slice
;
use
Bio::EnsEMBL::
AffyFeature
;
use
Bio::EnsEMBL::
AffyProbe
;
use
Bio::EnsEMBL::
AffyArray
;
use
Bio::EnsEMBL::Test::
TestUtils
qw( test_getter_setter debug )
;
BEGIN
{
$|
=
1
;
use
Test
;
plan
tests
=>
18
;
}
our
$verbose
=
0
;
verbose
('
WARNING
');
#
# Affy arrays dont have to have anythong more than a name,
# but it should be possible to have some other information on them
#
my
$another_array
=
undef
;
my
$affy_array
=
Bio::EnsEMBL::
AffyArray
->
new
(
-
name
=>
"
Affy-1
",
-
setsize
=>
11
,
-
included_in
=>
$another_array
,
-
probecount
=>
4443
);
ok
(
ref
(
$affy_array
)
&&
$affy_array
->
isa
(
"
Bio::EnsEMBL::AffyArray
"
));
#
# What Affy arryas should be able to do
#
ok
(
test_getter_setter
(
$affy_array
,
"
dbID
",
3
));
ok
(
test_getter_setter
(
$affy_array
,
"
adaptor
",
undef
));
ok
(
test_getter_setter
(
$affy_array
,
"
name
",
"
Some name
"
));
ok
(
test_getter_setter
(
$affy_array
,
"
setsize
",
11
));
# possibly do the following with database connection
my
$probes
=
$affy_array
->
get_all_AffyProbes
();
ok
(
#
# Create an AffyProbe
#
my
$affy_probe
=
Bio::EnsEMBL::
AffyProbe
->
new
(
-
arrayname
=>
"
AFFY-1
",
-
probename
=>
"
123-145
",
-
probeset
=>
"
affy_probeset
"
);
my
$affy_probe
=
Bio::EnsEMBL::
AffyProbe
->
new
(
-
array
=>
$affy_array
,
-
probename
=>
"
123-145
",
-
probeset
=>
"
affy_probeset
"
);
ok
(
ref
(
$affy_probe
)
&&
$affy_probe
->
isa
(
"
Bio::EnsEMBL::AffyProbe
"
));
my
$merge_probe
=
Bio::EnsEMBL::
AffyProbe
->
new
(
-
arraynames
=>
[
"
Affy-1
",
"
Affy-2
",
"
Affy-3
"
],
-
probenames
=>
[
"
123-145
",
"
23,24,56
",
"
someplace
"
],
-
probeset
=>
"
affy_probeset
"
)
ok
(
ref
(
$merge_probe
)
&&
$merge_probe
->
isa
(
"
Bio::EnsEMBL::AffyProbe
"
));
#
# What probes need to be able to do
#
ok
(
test_getter_setter
(
$merge_probe
,
"
dbID
",
1
));
ok
(
test_getter_setter
(
$merge_probe
,
"
adaptor
",
{}
));
ok
(
test_getter_setter
(
$merge_probe
,
"
probeset
",
"
Affy_probeset
"
));
# This is expected to access the database
my
$features
=
$affy_probe
->
get_all_AffyFeatures
();
ok
(
ref
(
$features
)
eq
"
ARRAY
"
);
ok
(
$features
->
[
0
]
&&
$features
->
[
0
]
->
isa
(
"
Bio::EnsEMBL::AffyFeature
"
));
my
$arrays
=
$affy_probe
->
get_all_AffyArrays
();
ok
(
ref
(
$arrays
)
eq
"
ARRAY
"
);
ok
(
$arrays
->
[
0
]
&&
$arrays
->
[
0
]
->
isa
(
"
Bio::EnsEMBL::AffyArray
"
));
# expected to construct full probenames from Chipname, setname and probename
my
$full_probenames
=
$merge_probe
->
get_complete_names
();
ok
(
ref
(
$full_probenames
)
eq
'
ARRAY
'
);
ok
(
$full_probenames
->
[
0
]
&&
(
$full_probenames
->
[
0
]
=~
/affy_probeset/
));
my
$full_probename
=
$merge_probe
->
get_complete_name
(
$affy_array
);
ok
(
$full_probename
=~
/affy_probeset/
&&
$full_probename
=~
/$affy_array->name()/
);
my
$probenames
=
$merge_probe
->
get_probenames
();
my
$probename
=
$merge_probe
->
get_probename
(
$affy_array
);
#
# When we implement storing this should be implemented as well
# for starters we are not creating these objects, but load the database with probes ...
$affy_probe
->
add_array_name
(
$affy_array
,
$probename
);
#
# Create an affy feature
#
my
$coord_system
=
Bio::EnsEMBL::
CoordSystem
->
new
(
-
name
=>
"
chromosome
",
-
version
=>
''
);
my
$slice
=
Bio::EnsEMBL::
Slice
->
new
(
-
seq_region_name
=>
'
1
',
-
coord_system
=>
$coord_system
,
-
start
=>
1
,
-
end
=>
50
,
-
seq_region_length
=>
200_000_000
);
my
$affy_feature
=
Bio::EnsEMBL::
AffyFeature
->
new
(
-
probe
=>
$affy_probe
,
-
slice
=>
$slice
,
-
start
=>
1
,
-
end
=>
10
,
-
strand
=>
-
1
,
-
probeset
=>
"
affy_probeset
"
);
ok
(
ref
(
$affy_feature
)
&&
$affy_feature
->
isa
(
"
Bio::EnsEMBL::AffyFeature
"));
1
;
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