2 ## Bioperl Test Harness Script for Modules
8 test_begin(-tests => 7,
9 -requires_networking => 1);
10 use_ok('Bio::Tools::Run::Ensembl');
13 my $setup_ok = Bio::Tools::Run::Ensembl->registry_setup();
15 # test database access
17 test_skip(-tests => 6, -requires_module => 'Bio::EnsEMBL::Registry');
18 skip("There was some problem contacting the EnsEMBL database?", 6) unless $setup_ok;
21 ok my $adaptor = Bio::Tools::Run::Ensembl->get_adaptor('human', 'Exon');
22 isa_ok $adaptor, 'Bio::EnsEMBL::DBSQL::ExonAdaptor';
23 if ($adaptor->can('species_id')) {
24 is $adaptor->species_id, 1;
30 # get an 'easy' gene - one that is in Ensembl
31 ok my $gene = Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
33 isa_ok $gene, 'Bio::EnsEMBL::Gene';
34 is $gene->external_name, 'BRCA2';
37 #*** don't know suitable gene names to test the following, to be completed...
39 # get one that isn't in human, but is in an orthologue
41 #ok ! Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
42 # -name => $orth_only);
43 #ok $gene = Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
44 # -use_orthologues => 'Mus musculus',
45 # -name => $orth_only);
46 #is $gene->external_name, $orth_only;
48 # get one that isn't in Ensembl but is in Swissprot
49 my $swiss_only = '??';
50 #ok ! Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
51 # -use_orthologues => 'Mus musculus',
52 # -name => $swiss_only);
53 #ok $gene = Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
54 # -use_orthologues => 'Mus musculus',
55 # -use_swiss_lookup => 1,
56 # -name => $swiss_only);
57 #is $gene->external_name, $swiss_only;
59 # get one that isn't in Swissprot either, but is in NCBI
61 #ok ! Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
62 # -use_orthologues => 'Mus musculus',
63 # -use_swiss_lookup => 1,
64 # -name => $ncbi_only);
65 #ok $gene = Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
66 # -use_orthologues => 'Mus musculus',
67 # -use_swiss_lookup => 1,
68 # -use_entrez_lookup => 1,
69 # -name => $ncbi_only);
70 #is $gene->external_name, $ncbi_only;