Commit 42e0bfba authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Added tests for Gene::get_all_homologous_Genes()

parent 775ec754
......@@ -34,5 +34,8 @@
'mapping' => {
'core' => 'Bio::EnsEMBL::DBSQL::DBAdaptor',
},
'multi' => {
'compara' => 'Bio::EnsEMBL::Compara::DBSQL::DBAdaptor',
},
},
}
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016] 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::DBSQL::OntologyDBAdaptor;
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;
my $human = Bio::EnsEMBL::Test::MultiTestDB->new('homo_sapiens');
my $mouse = Bio::EnsEMBL::Test::MultiTestDB->new('mus_musculus');
my $multi = Bio::EnsEMBL::Test::MultiTestDB->new('multi');
my $core_db = $human->get_DBAdaptor('core');
my $compara_db = $multi->get_DBAdaptor('compara');
## Gene::get_all_homologous_Genes()
my $human_gene = $core_db->get_GeneAdaptor->fetch_by_stable_id('ENSG00000174852');
my $homologues = $human_gene->get_all_homologous_Genes();
is(scalar(@$homologues), 46, 'Got all the homologues');
sub _check_consistency {
my $triplet = shift;
subtest $triplet->[2], sub {
isa_ok($triplet->[0], 'Bio::EnsEMBL::Gene');
isa_ok($triplet->[1], 'Bio::EnsEMBL::Compara::Homology');
my $members = $triplet->[1]->get_all_Members;
is($members->[0]->gene_member->stable_id, 'ENSG00000174852', 'The query gene is correct');
is($triplet->[0]->stable_id, $members->[1]->gene_member->stable_id, 'The target gene is consistent between Gene and Homology');
is($members->[1]->genome_db->name, $triplet->[2], 'The species name is correct');
};
};
my $mouse_gene = $mouse->get_DBAdaptor('core')->get_GeneAdaptor->fetch_by_stable_id('ENSMUSG00000088524');
my @mouse_triplets = grep {$_->[2] eq 'mus_musculus'} @$homologues;
is(scalar(@mouse_triplets), 1, 'One with mouse');
my $mouse_triplet = $mouse_triplets[0];
_check_consistency($mouse_triplet);
subtest 'Mouse triplet', sub {
ok($mouse_gene->equals($mouse_triplet->[0]), 'The mouse gene is correct');
is($mouse_triplet->[1]->method_link_species_set_id, 50976, 'mouse homology mlss_id');
is($mouse_triplet->[1]->dbID, 100972489, 'mouse homology dbID');
};
# For species with no core database, the Gene object is an empty shell
my @dog_triplets = grep {$_->[2] eq 'canis_familiaris'} @$homologues;
is(scalar(@dog_triplets), 1, 'One with dog');
my $dog_triplet = $dog_triplets[0];
_check_consistency($dog_triplet);
subtest 'Dog triplet', sub {
ok(!$dog_triplet->[0]->dbID, 'The dog gene is made up and has no dbID');
is($dog_triplet->[0]->stable_id, 'ENSCAFG00000027814', 'dog stable_id');
is($dog_triplet->[0]->description, 'Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299]', 'dog description');
is($dog_triplet->[1]->method_link_species_set_id, 50981, 'dog homology mlss_id');
is($dog_triplet->[1]->dbID, 100972657, 'dog homology dbID');
};
done_testing();
13705552 151834684 5 134 chromosome 1
4514314 7320470 15 65 chromosome 1
36722 675822 scaffold_166 4 scaffold 1
4514338 107808587 Un_random 65 chromosome 1
2039125 16798506 groupIII 36 group 1
4346076 202140232 3 60 chromosome 1
2039164 31848461 17 37 chromosome 1
1045569 169801366 7 31 chromosome 1
1045563 189746636 2 31 chromosome 1
12160504 27241186 9 87 chromosome 1
2175916 723 Contig213555 43 supercontig 1
13094385 1346504 GL172955.1 116 scaffold 1
13200476 158337067 1 122 chromosome 1
13203820 199944510 3 123 chromosome 1
12966556 163896628 14 108 chromosome 1
13049389 1378627 GL343321.1 111 scaffold 1
13705560 98207768 16 134 chromosome 1
13636391 3303274 JH126603.1 129 scaffold 1
13211504 202329955 3 125 chromosome 1
13785441 2670181 KB743644.1 144 scaffold 1
13783415 23441680 9 142 chromosome 1
13688462 12481155 GL831134.1 130 scaffold 1
13055709 24221871 11 112 chromosome 1
13705633 42124431 34 135 chromosome 1
12753243 22517 GeneScaffold_6359 91 genescaffold 1
13955520 133797422 10 150 chromosome 1
13862672 17670860 JH603178.1 145 scaffold 1
14022783 91754291 15 153 chromosome 1
13203897 11483068 GL873579.1 124 scaffold 1
13955574 162156779 7 151 chromosome 1
14026375 59543403 2 154 chromosome 1
14022801 84932903 24 153 chromosome 1
13902789 32369425 LG14 148 chromosome 1
13902799 275612895 1 147 chromosome 1
3570454 260857928 7 46 chromosome 1
14018859 2562819 KI519677.1 152 scaffold 1
13701661 218635234 13 132 chromosome 1
4346125 59975221 19 61 chromosome 1
14026979 90463843 11 155 chromosome 1
13955539 198295559 3 150 chromosome 1
11302777 39289 GeneScaffold_5302 82 genescaffold 1
100000065 ENSTNIG00000020505 0 ENSEMBLGENE 99883 65 100000065 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 4514314 3306094 3306168 1 SNORD2 0 1 1 57 2 0
100002261 ENSTRUG00000019469 0 ENSEMBLGENE 31033 4 100002260 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 36722 268619 268692 1 SNORD2 0 1 1 58 1 0
100002264 ENSTRUG00000019394 0 ENSEMBLGENE 31033 4 100002264 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 36722 269022 269095 1 SNORD2 0 1 1 48 1 0
100003686 ENSTNIG00000020529 0 ENSEMBLGENE 99883 65 100003686 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 4514338 52669397 52669470 -1 SNORD2 0 1 1 48 2 0
100003687 ENSTNIG00000020519 0 ENSEMBLGENE 99883 65 100003688 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 4514338 52669729 52669803 -1 SNORD2 0 1 1 57 2 0
100008184 ENSGACG00000022790 0 ENSEMBLGENE 69293 36 100008184 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 2039125 9224992 9225064 1 SNORD2 0 1 1 58 1 0
100008186 ENSGACG00000022791 0 ENSEMBLGENE 69293 36 100008186 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 2039125 9225550 9225621 1 SNORD2 0 1 1 48 1 0
100009977 ENSPPYG00000028034 0 ENSEMBLGENE 9601 60 100009977 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 4346076 190574508 190574576 1 SNORD2 0 1 1 45 1 0
100016849 ENSORLG00000021574 0 ENSEMBLGENE 8090 37 100016849 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 2039164 14653720 14653794 1 SNORD2 0 1 1 58 1 0
100016850 ENSORLG00000021634 0 ENSEMBLGENE 8090 37 100016850 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 2039164 14654245 14654320 1 SNORD2 0 1 1 48 1 0
100029371 ENSMMUG00000036232 0 ENSEMBLGENE 9544 31 100029371 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 1045569 164954481 164954549 1 SNORD2 0 1 1 33 3 0
100033919 ENSMMUG00000037192 0 ENSEMBLGENE 9544 31 100033919 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 1045563 179142348 179142416 1 SNORD2 0 1 1 44 3 0
100046335 ENSTGUG00000018017 0 ENSEMBLGENE 59729 87 100046335 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 12160504 18582628 18582698 1 SNORD2 0 1 1 58 0 0
100047101 ENSOANG00000027382 0 ENSEMBLGENE 9258 43 100047100 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 2175916 513 593 -1 SNORD2 0 1 1 58 0 0
100054945 ENSXETG00000029617 0 ENSEMBLGENE 8364 116 100054945 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13094385 381059 381128 -1 SNORD2 0 1 1 49 1 0
100054946 ENSXETG00000029793 0 ENSEMBLGENE 8364 116 100054946 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13094385 385005 385076 -1 SNORD2 0 1 1 58 1 0
100065013 ENSBTAG00000044311 0 ENSEMBLGENE 9913 122 100065013 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13200476 81062767 81062835 -1 SNORD2 0 1 1 47 0 0
100071636 ENSGGOG00000032407 0 ENSEMBLGENE 9595 123 100071636 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13203820 188240400 188240468 1 SNORD2 0 1 1 45 1 0
100087720 ENSOCUG00000023265 0 ENSEMBLGENE 9986 108 100088181 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 12966556 78843854 78843921 -1 SNORD2 0 1 1 45 2 0
100093454 ENSACAG00000018292 0 ENSEMBLGENE 28377 111 100094079 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13049389 118621 118692 -1 SNORD2 0 1 1 58 0 0
100099604 ENSMUSG00000088524 0 ENSEMBLGENE 10090 134 100100368 small nucleolar RNA, C/D box 2 [Source:MGI Symbol;Acc:MGI:3819528] 13705560 23108953 23109021 1 Snord2 0 1 1 45 0 0
100099742 ENSLACG00000021456 0 ENSEMBLGENE 7897 129 100100505 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13636391 2411690 2411759 1 SNORD2 0 1 1 49 0 0
100113582 ENSPTRG00000037854 0 ENSEMBLGENE 9598 125 100114678 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13211504 190852362 190852430 1 SNORD2 0 1 1 45 1 0
100123418 ENSAPLG00000000068 0 ENSEMBLGENE 8839 144 100124975 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13785441 276440 276510 1 SNORD2 0 1 1 58 0 0
100130549 ENSGALG00000025617 0 ENSEMBLGENE 9031 142 100132105 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13783415 15672950 15673019 1 SNORD2 0 1 1 58 0 0
100137301 ENSONIG00000022215 0 ENSEMBLGENE 8128 130 100138857 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13688462 12140155 12140229 1 SNORD2 0 1 1 58 1 0
100137304 ENSONIG00000022099 0 ENSEMBLGENE 8128 130 100138860 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13688462 12140712 12140786 1 SNORD2 0 1 1 48 1 0
100151878 ENSMGAG00000000091 0 ENSEMBLGENE 9103 112 100153475 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13055709 16212140 16212209 1 SNORD2 0 1 1 58 0 0
100162160 ENSCAFG00000027814 0 ENSEMBLGENE 9615 135 100164038 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13705633 19356118 19356186 1 SNORD2 0 1 1 45 5 0
100164895 ENSMEUG00000017324 0 ENSEMBLGENE 9315 91 100166821 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 12753243 17043 17112 1 SNORD2 0 1 1 58 0 0
100176264 ENSG00000238707 0 ENSEMBLGENE 9606 150 100178494 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13955520 56595963 56596031 -1 SNORD2 0 1 1 45 1 0
100182621 ENSFALG00000015549 0 ENSEMBLGENE 59894 145 100185036 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13862672 11103001 11103071 1 SNORD2 0 1 1 58 0 0
100184508 ENSCSAG00000026646 0 ENSEMBLGENE 60711 153 100186963 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14022783 81076307 81076375 1 SNORD2 0 1 1 44 2 0
100191757 ENSOGAG00000023959 0 ENSEMBLGENE 30611 124 100194492 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13203897 9863584 9863651 -1 SNORD2 0 1 1 45 0 0
100204308 ENSPANG00000010082 0 ENSEMBLGENE 9555 151 100207705 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13955574 157844257 157844325 1 SNORD2 0 1 1 45 1 0
100215815 ENSDARG00000082639 0 ENSEMBLGENE 7955 154 100220003 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14026375 7922554 7922624 1 SNORD2 0 1 1 48 2 0
100215819 ENSDARG00000083056 0 ENSEMBLGENE 7955 154 100220007 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14026375 7922934 7923004 1 SNORD2 0 1 1 42 2 0
100215833 ENSDARG00000080523 0 ENSEMBLGENE 7955 154 100220025 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14026375 7925865 7925936 1 SNORD2 0 1 1 58 2 0
100220485 ENSCSAG00000027032 0 ENSEMBLGENE 60711 153 100225049 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14022801 79602435 79602503 1 SNORD2 0 1 1 33 2 0
100223263 ENSLOCG00000019102 0 ENSEMBLGENE 7918 148 100227949 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13902789 461949 462018 1 SNORD2 0 1 1 58 0 0
100226195 ENSOARG00000022667 0 ENSEMBLGENE 9940 147 100231022 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13902799 198671751 198671819 -1 SNORD2 0 1 1 47 1 0
100235573 ENSMODG00000026826 0 ENSEMBLGENE 13616 46 100240803 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 3570454 206772418 206772486 -1 SNORD2 0 1 1 58 0 0
100238959 ENSPFOG00000021602 0 ENSEMBLGENE 48698 152 100244296 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14018859 380507 380583 1 SNORD2 0 1 1 58 1 0
100238967 ENSPFOG00000021430 0 ENSEMBLGENE 48698 152 100244304 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14018859 381062 381137 1 SNORD2 0 1 1 48 1 0
100242730 ENSSSCG00000018746 0 ENSEMBLGENE 9823 132 100248134 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 13701661 133974703 133974771 1 SNORD2 0 1 1 45 2 0
100246488 ENSECAG00000027514 0 ENSEMBLGENE 9796 61 100252028 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 4346125 24791922 24791988 1 SNORD2 0 1 1 45 1 0
100263700 ENSRNOG00000053621 0 ENSEMBLGENE 10116 155 100270056 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 14026979 81378396 81378464 -1 SNORD2 0 1 1 45 0 0
100277999 ENSG00000174852 0 ENSEMBLGENE 9606 150 100285954 small nucleolar RNA, C/D box 2 [Source:HGNC Symbol;Acc:HGNC:32678] 13955539 186784796 186784864 1 SNORD2 0 1 1 45 1 0
100281324 ENSTSYG00000021671 0 ENSEMBLGENE 9478 82 100289437 Small nucleolar RNA SNORD2 [Source:RFAM;Acc:RF01299] 11302777 17893 17961 1 SNORD2 0 1 1 45 0 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment