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

View of /FigMetagenomeTools/public_metagenomes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Nov 28 18:31:40 2008 UTC (11 years, 2 months ago) by redwards
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_release_3_0, mgrast_dev_03252011, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, myrast_33, mgrast_dev_04052011, mgrast_dev_02222011, HEAD
new code for accessing the metagenomes and getting their sims out

#__perl__
#
=pod

=head1 public_metagenomes

List all the public metagenomes, and a little information about them

=author

Rob Edwards, November, 2008

=cut

use strict;
use DBMaster;
use MGRAST::MGRAST qw/get_public_metagenomes/;

# These are some pieces that I stole from other code.

# check for job directory
unless(defined($FIG_Config::mgrast_jobs)) {
  die "No job directory found in FIG_Config.pm.";
}

# check for web application db settings in FIG_Config
unless(defined($FIG_Config::webapplication_db) and
       defined($FIG_Config::webapplication_backend)) {
  die "No webapplication db settings found in FIG_Config.pm.";
}

# init PPO 
my $backend  = 'MySQL';
my $database = $FIG_Config::mgrast_jobcache_db || 'jobcache.db';
my $dbmaster = DBMaster->new(-database => $database,
                             -backend  => $backend,
                             -host     => $FIG_Config::mgrast_jobcache_host,
                             -user     => $FIG_Config::mgrast_jobcache_user,
                             -password => $FIG_Config::mgrast_jobcache_password
                            );

my $pj=get_public_metagenomes($dbmaster);

print join("\t", "Genome Name", "Internal ID", "Genome ID", "Size (bp)", "MG-RAST version"), "\n";
foreach my $j (@$pj) {
	print join("\t", map {$j->{$_}} (qw[genome_name id genome_id size server_version])), "\n";	
}



MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3