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
fc8942be
Commit
fc8942be
authored
7 years ago
by
Tiago Grego
Browse files
Options
Downloads
Patches
Plain Diff
Added tests for biotype
parent
ccfa2762
No related branches found
No related tags found
2 merge requests
!228
Biotype in Core schema
,
!228
Biotype in Core schema
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/t/biotype.t
+79
-0
79 additions, 0 deletions
modules/t/biotype.t
modules/t/test-genome-DBs/homo_sapiens/core/biotype.txt
+4
-0
4 additions, 0 deletions
modules/t/test-genome-DBs/homo_sapiens/core/biotype.txt
with
83 additions
and
0 deletions
modules/t/biotype.t
0 → 100644
+
79
−
0
View file @
fc8942be
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2018] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use
strict
;
use
warnings
;
use
Test::
More
;
use
Test::
Warnings
qw( allow_warnings )
;
use
Test::
Exception
;
use
Bio::EnsEMBL::Test::
MultiTestDB
;
use
Bio::EnsEMBL::Test::
TestUtils
;
our
$verbose
=
0
;
#set to 1 to turn on debug printouts
# Get a DBAdaptor to from the test system
my
$multi
=
Bio::EnsEMBL::Test::
MultiTestDB
->
new
;
ok
(
$multi
);
my
$db
=
$multi
->
get_DBAdaptor
("
core
");
ok
(
$db
);
# Should get meaningful type back
debug
("
get biotype adaptor
");
my
$biotype_adaptor
=
$db
->
get_BiotypeAdaptor
();
ok
(
$biotype_adaptor
->
isa
("
Bio::EnsEMBL::DBSQL::BiotypeAdaptor
"));
# fetch a protein_coding gene object
debug
("
fetch gene
");
my
$ga
=
$db
->
get_GeneAdaptor
();
my
$gene
=
$ga
->
fetch_by_stable_id
("
ENSG00000171456
");
ok
(
$gene
);
# test biotype related methods on this gene object
debug
("
gene biotype
");
is
(
$gene
->
{'
biotype
'},
'
protein_coding
');
is
(
$gene
->
biotype
,
'
protein_coding
');
# test gene biotype object
my
$biotype
=
$gene
->
biotype
;
ok
(
$biotype
->
isa
("
Bio::EnsEMBL::Biotype
"));
is
(
$biotype
->
object_type
,
'
gene
',
'
Biotype is from Gene object
');
is
(
$biotype
->
name
,
'
protein_coding
',
'
Biotype name is protein_coding
');
is
(
$biotype
->
biotype_group
,
'
coding
',
'
Biotype group is coding
');
is
(
$biotype
->
so_acc
,
'
SO:0001217
',
'
Biotype protein_coding refers to SO:0001217
');
throws_ok
{
$biotype
->
so_acc
('
test
')
}
qr/so_acc must be a Sequence Ontology accession/
,
'
so_acc() requires a SO acc like string
';
throws_ok
{
$biotype
->
object_type
('
test
')
}
qr/object_type must be gene or transcript/
,
'
object_type() must be gene or transcript
';
# test transcript biotype object
my
$transcript
=
$gene
->
canonical_transcript
;
debug
("
transcript biotype
");
is
(
$transcript
->
{'
biotype
'},
'
protein_coding
');
is
(
$transcript
->
biotype
,
'
protein_coding
');
$biotype
=
$transcript
->
biotype
;
ok
(
$biotype
->
isa
("
Bio::EnsEMBL::Biotype
"));
is
(
$biotype
->
object_type
,
'
transcript
',
'
Biotype is from Transcript object
');
is
(
$biotype
->
name
,
'
protein_coding
',
'
Biotype name is protein_coding
');
is
(
$biotype
->
biotype_group
,
'
coding
',
'
Biotype group is coding
');
is
(
$biotype
->
so_acc
,
'
SO:0000234
',
'
Biotype protein_coding refers to SO:0000234
');
# test fetch biotypes of object_type gene
my
$biotypes
=
$biotype_adaptor
->
fetch_all_by_object_type
('
gene
');
is
(
ref
$biotypes
,
'
ARRAY
',
'
got an array
');
is
(
scalar
@
{
$biotypes
},
'
2
',
'
of size 2
');
done_testing
();
This diff is collapsed.
Click to expand it.
modules/t/test-genome-DBs/homo_sapiens/core/biotype.txt
0 → 100644
+
4
−
0
View file @
fc8942be
64 protein_coding gene core,otherfeatures,rnaseq,vega,presite \N \N coding SO:0001217
65 protein_coding transcript core,otherfeatures,rnaseq,vega,presite \N \N coding SO:0000234
87 tRNA gene core,otherfeatures,presite 76 \N snoncoding SO:0001263
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