[Bio] / FigMetagenomeTools / public_metagenomes.pl Repository:
ViewVC logotype

Annotation of /FigMetagenomeTools/public_metagenomes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : redwards 1.1 #__perl__
2 :     #
3 :     =pod
4 :    
5 :     =head1 public_metagenomes
6 :    
7 :     List all the public metagenomes, and a little information about them
8 :    
9 :     =author
10 :    
11 :     Rob Edwards, November, 2008
12 :    
13 :     =cut
14 :    
15 :     use strict;
16 :     use DBMaster;
17 :     use MGRAST::MGRAST qw/get_public_metagenomes/;
18 :    
19 :     # These are some pieces that I stole from other code.
20 :    
21 :     # check for job directory
22 :     unless(defined($FIG_Config::mgrast_jobs)) {
23 :     die "No job directory found in FIG_Config.pm.";
24 :     }
25 :    
26 :     # check for web application db settings in FIG_Config
27 :     unless(defined($FIG_Config::webapplication_db) and
28 :     defined($FIG_Config::webapplication_backend)) {
29 :     die "No webapplication db settings found in FIG_Config.pm.";
30 :     }
31 :    
32 :     # init PPO
33 :     my $backend = 'MySQL';
34 :     my $database = $FIG_Config::mgrast_jobcache_db || 'jobcache.db';
35 :     my $dbmaster = DBMaster->new(-database => $database,
36 :     -backend => $backend,
37 :     -host => $FIG_Config::mgrast_jobcache_host,
38 :     -user => $FIG_Config::mgrast_jobcache_user,
39 :     -password => $FIG_Config::mgrast_jobcache_password
40 :     );
41 :    
42 :     my $pj=get_public_metagenomes($dbmaster);
43 :    
44 :     print join("\t", "Genome Name", "Internal ID", "Genome ID", "Size (bp)", "MG-RAST version"), "\n";
45 :     foreach my $j (@$pj) {
46 :     print join("\t", map {$j->{$_}} (qw[genome_name id genome_id size server_version])), "\n";
47 :     }
48 :    
49 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3