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
cfb7a637
Commit
cfb7a637
authored
11 years ago
by
Alessandro Vullo
Browse files
Options
Downloads
Patches
Plain Diff
Updates to reflect changes in SequenceOntologyMapper interface.
Removed dependencies on non-core APIs.
parent
7bc92775
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/sequenceOntologyMapper.t
+25
-34
25 additions, 34 deletions
modules/t/sequenceOntologyMapper.t
with
25 additions
and
34 deletions
modules/t/sequenceOntologyMapper.t
+
25
−
34
View file @
cfb7a637
...
...
@@ -25,10 +25,6 @@ use Bio::EnsEMBL::Slice;
use
Bio::EnsEMBL::
SimpleFeature
;
use
Bio::EnsEMBL::
MiscFeature
;
use
Bio::EnsEMBL::
RepeatFeature
;
use
Bio::EnsEMBL::Variation::
VariationFeature
;
use
Bio::EnsEMBL::Variation::
StructuralVariationFeature
;
use
Bio::EnsEMBL::Compara::
ConstrainedElement
;
use
Bio::EnsEMBL::Funcgen::
RegulatoryFeature
;
# Module compiles
ok
(
1
,
'
Bio::EnsEMBL::Utils::SequenceOntologyMapper compiles
');
...
...
@@ -37,22 +33,9 @@ ok(1, 'Bio::EnsEMBL::Utils::SequenceOntologyMapper compiles');
# Test constructor
#
throws_ok
{
new
Bio::EnsEMBL::Utils::
SequenceOntologyMapper
()
}
qr /No
ontology
term
adaptor
/
,
"
constructor with no arg
ument
raises exception
";
qr /No
ontology
term
adaptor
/
,
"
constructor with no arg raises exception
";
throws_ok
{
new
Bio::EnsEMBL::Utils::
SequenceOntologyMapper
(
bless
({},
'
Someclass
'))
}
qr /Argument
is
not
/
,
"
constructor with object not of class OntologyTermAdaptor raises exception
";
# my $registry = 'Bio::EnsEMBL::Registry';
# Bio::EnsEMBL::Registry->no_version_check(1);
# Bio::EnsEMBL::Registry->no_cache_warnings(1);
# $registry->load_registry_from_db(-host => '127.0.0.1',
# -port => 33061,
# -db_version => 73,
# -user => 'ensro',
# -no_cache => 1);
# my $oa = $registry->get_adaptor( 'Multi', 'Ontology', 'OntologyTerm' );
# assert_ref($oa, 'Bio::EnsEMBL::DBSQL::OntologyTermAdaptor');
qr /Argument
is
not
/
,
"
constructor with arg not of class OntologyTermAdaptor raises exception
";
my
$omulti
=
Bio::EnsEMBL::Test::
MultiTestDB
->
new
('
ontology
');
my
$odb
=
$omulti
->
get_DBAdaptor
('
ontology
');
...
...
@@ -62,33 +45,41 @@ my $mapper = Bio::EnsEMBL::Utils::SequenceOntologyMapper->new($oa);
isa_ok
(
$mapper
,
'
Bio::EnsEMBL::Utils::SequenceOntologyMapper
');
#
# Test t
ranslat
e method
# Test t
o_accession/to_nam
e method
s
#
my
$multi
=
Bio::EnsEMBL::Test::
MultiTestDB
->
new
;
my
$db
=
$multi
->
get_DBAdaptor
('
core
');
my
$mappings
=
[
{
obj
=>
Bio::EnsEMBL::
Feature
->
new
,
term
=>
'
region
'
},
{
obj
=>
Bio::EnsEMBL::
Gene
->
new
,
term
=>
'
gene
'
},
{
obj
=>
Bio::EnsEMBL::
Transcript
->
new
,
term
=>
'
transcript
'
},
{
obj
=>
Bio::EnsEMBL::
Exon
->
new
,
term
=>
'
exon
'
},
{
obj
=>
$db
->
get_SliceAdaptor
->
fetch_by_region
('
chromosome
',
'
20
',
30_270_000
,
31_200_000
),
term
=>
'
region
'
},
{
obj
=>
Bio::EnsEMBL::
SimpleFeature
->
new
(),
term
=>
'
biological_region
'
},
{
obj
=>
Bio::EnsEMBL::
MiscFeature
->
new
(),
term
=>
'
biological_region
'
},
{
obj
=>
Bio::EnsEMBL::
RepeatFeature
->
new
(),
term
=>
'
repeat_region
'
},
{
obj
=>
Bio::EnsEMBL::Variation::
VariationFeature
->
new
(),
term
=>
'
sequence_variant
'
},
{
obj
=>
Bio::EnsEMBL::Variation::
StructuralVariationFeature
->
new
(),
term
=>
'
structural_variant
'
},
{
obj
=>
Bio::EnsEMBL::Compara::
ConstrainedElement
->
new
(),
term
=>
'
DNA_constraint_sequence
'
}
# 'Bio::EnsEMBL::Funcgen::RegulatoryFeature' => 'regulatory_region'
# test generic feature
{
obj
=>
Bio::EnsEMBL::
Feature
->
new
(),
accession
=>
'
SO:0000001
',
name
=>
'
region
'
},
# test various genes with/without biotypes
{
obj
=>
Bio::EnsEMBL::
Gene
->
new
(),
accession
=>
'
SO:0000704
',
name
=>
'
gene
'
},
{
obj
=>
Bio::EnsEMBL::
Gene
->
new
(
-
biotype
=>
'
protein_coding
'),
accession
=>
'
SO:0001217
',
name
=>
'
protein_coding_gene
'
},
{
obj
=>
Bio::EnsEMBL::
Gene
->
new
(
-
biotype
=>
'
tRNA
'),
accession
=>
'
SO:0001272
',
name
=>
'
tRNA_gene
'
},
# test various transcripts with/without biotypes
{
obj
=>
Bio::EnsEMBL::
Transcript
->
new
(),
accession
=>
'
SO:0000673
',
name
=>
'
transcript
'
},
{
obj
=>
Bio::EnsEMBL::
Transcript
->
new
(
-
biotype
=>
'
processed_transcript
'),
accession
=>
'
SO:0001503
',
name
=>
'
processed_transcript
'
},
{
obj
=>
Bio::EnsEMBL::
Transcript
->
new
(
-
biotype
=>
'
retrotransposed
'),
accession
=>
'
SO:0000569
',
name
=>
'
retrotransposed
'
},
# exons
{
obj
=>
Bio::EnsEMBL::
Exon
->
new
,
accession
=>
'
SO:0000147
',
name
=>
'
exon
'
},
# slices
{
obj
=>
$db
->
get_SliceAdaptor
->
fetch_by_region
('
chromosome
',
'
20
',
30_270_000
,
31_200_000
),
accession
=>
'
SO:0000001
',
name
=>
'
region
'
},
# simple features
{
obj
=>
Bio::EnsEMBL::
SimpleFeature
->
new
(),
accession
=>
'
SO:0001411
',
name
=>
'
biological_region
'
},
# misc features
{
obj
=>
Bio::EnsEMBL::
MiscFeature
->
new
(),
accession
=>
'
SO:0001411
',
name
=>
'
biological_region
'
},
# repeat feature
{
obj
=>
Bio::EnsEMBL::
RepeatFeature
->
new
(),
accession
=>
'
SO:0000657
',
name
=>
'
repeat_region
'
},
];
throws_ok
{
$mapper
->
translate
(
bless
({},
'
Someclass
'))
}
qr /not
found
/
,
"
translate method raises exception
";
map
{
print
ref
(
$_
->
{
obj
})
and
is
(
$mapper
->
translate
(
$_
->
{
obj
}),
$_
->
{
term
},
sprintf
"
%s translates as assumed
",
ref
(
$_
->
{
obj
}))
}
is
(
$mapper
->
to_accession
(
$_
->
{
obj
}),
$_
->
{
accession
},
sprintf
"
%s maps to correct accession
",
ref
(
$_
->
{
obj
}))
and
is
(
$mapper
->
to_name
(
$_
->
{
obj
}),
$_
->
{
name
},
sprintf
"
%s maps to correct
",
ref
(
$_
->
{
obj
}))
}
@
{
$mappings
};
done_testing
();
...
...
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