-
Alessandro Vullo authored8251727b
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
gene.t 21.47 KiB
# Copyright [1999-2013] Wellcome Trust Sanger Institute and the 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::Exception;
use Data::Dumper;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Exon;
use Bio::EnsEMBL::FeaturePair;
use Bio::EnsEMBL::Transcript;
use Bio::EnsEMBL::Translation;
use Bio::EnsEMBL::Gene;
use Bio::EnsEMBL::DnaDnaAlignFeature;
# switch on the debug prints
our $verbose = 0;
debug("Startup test");
ok(1);
my $multi = Bio::EnsEMBL::Test::MultiTestDB->new();
my $db = $multi->get_DBAdaptor("core");
debug("Test database instatiated");
ok($db);
my $gene;
my $ga = $db->get_GeneAdaptor();
debug("Gene->list_dbIDs");
my $ids = $ga->list_dbIDs();
ok(@{$ids});
debug("Gene->list_stable_ids");
my $stable_ids = $ga->list_stable_ids();
ok(@{$stable_ids});
$gene = $ga->fetch_by_display_label("T9S4_HUMAN");
ok($gene && $gene->dbID() == 18262);
$gene = $ga->fetch_by_stable_id("ENSG00000171456");
debug("Gene->fetch_by_stable_id()");
ok($gene);
my @date_time = localtime($gene->created_date());
ok($date_time[3] == 6 && $date_time[4] == 11 && $date_time[5] == 104);
@date_time = localtime($gene->modified_date());
ok($date_time[3] == 6 && $date_time[4] == 11 && $date_time[5] == 104);
debug("Gene dbID: " . $gene->dbID());
ok($gene->dbID() == 18267);