~ubuntu-branches/ubuntu/karmic/bioperl/karmic

« back to all changes in this revision

Viewing changes to scripts/taxa/local_taxonomydb_query.PLS

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2007-09-21 22:52:22 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070921225222-tt20m2yy6ycuy2d8
Tags: 1.5.2.102-1
* Developer release.
* Upgraded source package to debhelper 5 and standards-version 3.7.2.
* Added libmodule-build-perl and libtest-harness-perl to
  build-depends-indep.
* Disabled automatic CRAN download.
* Using quilt instead of .diff.gz to manage modifications.
* Updated Recommends list for the binary package.
* Moved the "production-quality" scripts to /usr/bin/.
* New maintainer: Debian-Med packaging team mailing list.
* New uploaders: Charles Plessy and Steffen Moeller.
* Updated Depends, Recommends and Suggests.
* Imported in Debian-Med's SVN repository on Alioth.
* Executing the regression tests during package building.
* Moved the Homepage: field out from the package's description.
* Updated watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
my $verbose = 0;
8
8
my $plain   = 0;
9
9
my ($nodesfile,$namesfile);
10
 
 
 
10
my $idx_dir = '/tmp/idx';
11
11
GetOptions('v|verbose' => \$verbose,
12
12
           'nodes:s'   => \$nodesfile,
13
13
           'names:s'   => \$namesfile,
 
14
           'idx:s'     => \$idx_dir,
14
15
           'h|help'    => sub{ exec('perldoc',$0);
15
16
                                exit(0)
16
17
                                } );
19
20
    exec('perldoc',$0);
20
21
    exit(0);
21
22
}
 
23
mkdir($idx_dir) unless -d $idx_dir;
 
24
 
22
25
my $db = new Bio::DB::Taxonomy(-source    => 'flatfile',
23
26
                               -nodesfile => $nodesfile,
24
27
                               -namesfile => $namesfile,
25
 
                               -directory => '/tmp/idx');
 
28
                               -directory => $idx_dir);
26
29
foreach my $sp ( @ARGV ) {
27
 
    my $id = $db->get_taxonid($sp);
28
 
    print "id is $id for $sp\n";
 
30
    my $node = $db->get_Taxonomy_Node(-name => $sp);
 
31
    if( defined $node ) {
 
32
        print "id is ", $node->id, "\n"; # 9606
 
33
        print "rank is ", $node->rank, "\n"; # species
 
34
        print "scientific name is ", $node->scientific_name, "\n"; # Homo sapiens
 
35
        print "division is ", $node->division, "\n"; # Primates
 
36
    } else {
 
37
        warn("no node found for query $sp");
 
38
    }
29
39
}
30
40
 
31
41
=head1 NAME