[Bio] / FortyEightMeta / format_all_public_metagenomes.pl Repository:
ViewVC logotype

View of /FortyEightMeta/format_all_public_metagenomes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Fri Apr 3 05:29:32 2009 UTC (11 years 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
code to format all public metagenome contigs files

#__perl__


use strict;
use MGRAST::MGRAST;
use DBMaster;

use constant BACKEND  => 'MySQL';
use constant DATABASE => 'jobcache.db';


# init PPO 
my $backend  = BACKEND;
my $database = $FIG_Config::mgrast_jobcache_db || DATABASE;
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 $pjobs = MGRAST::MGRAST::get_public_metagenomes($dbmaster);

foreach my $job (@$pjobs) {
	my $dir = $job->{id};
	my $gid = $job->{genome_id};
	my $rpdir = $FIG_Config::mgrast_jobs."/$dir/rp/$gid";
	unless (-e "$rpdir/contigs") {
		print STDERR "no contigs for $dir and $gid\n";
		next;
	}

	if (-e "$rpdir/contigs.nhr" && -e "$rpdir/contigs.nin" && -e "$rpdir/contigs.nsq") { # already formatted;
		print "$dir already formatted\n";
		next;
	}
	
	my $name = $job->{genome_name};

	my $cmd = "formatdb -i $rpdir/contigs -pF -t '$name' -l $rpdir/formatdb.log";
	print "formatting $dir\n", `$cmd`;
}






MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3