Supply TEMPLATE and SUFFIX for temporary query sequence files.
[bioperl-run.git] / t / Ensembl.t
blob0907ea7e6a36483c942fa18d5971fd7d7f2eb771
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
4 use strict;
6 BEGIN {
7     use Bio::Root::Test;
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
16 SKIP: {
17     test_skip(-tests => 6, -requires_module => 'Bio::EnsEMBL::Registry');
18     skip("There was some problem contacting the EnsEMBL database?", 6) unless $setup_ok;
19     
20     # get an adaptor
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;
25     }
26     else {
27         ok 1;
28     }
29     
30     # get an 'easy' gene - one that is in Ensembl
31     ok my $gene = Bio::Tools::Run::Ensembl->get_gene_by_name(-species => 'human',
32                                                              -name => 'BRCA2');
33     isa_ok $gene, 'Bio::EnsEMBL::Gene';
34     is $gene->external_name, 'BRCA2';
35     
36     
37     #*** don't know suitable gene names to test the following, to be completed...
38     
39     # get one that isn't in human, but is in an orthologue
40     my $orth_only = '??';
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;
47     
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;
58     
59     # get one that isn't in Swissprot either, but is in NCBI
60     my $ncbi_only = '??';
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;