[Bio] / FigKernelScripts / pg_add_genomes.pl Repository:
ViewVC logotype

View of /FigKernelScripts/pg_add_genomes.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Sun Feb 24 15:17:28 2013 UTC (6 years, 8 months ago) by overbeek
Branch: MAIN
CVS Tags: rast_rel_2014_0729, rast_rel_2014_0912, HEAD
add RAST genomeIDs to genome table

use strict;
use Data::Dumper;
use Getopt::Long;

my $usage = "usage: pg_add_genomes -d Data\n";
my $dataD;

my $rc  = GetOptions('d=s' => \$dataD);
if ((! $rc) || (! -d $dataD)) { print STDERR $usage; exit }

open(OUT,">$dataD/genomes.with.job.and.genomeID")
    || die "could not open $dataD/genomes.with.job.and.genomeID";

foreach $_ (`cat $dataD/genomes.with.job`)
{
    chop;
    my @flds = split(/\t/,$_);
    my $rast_job = $flds[-1];
    my $jobD = "/vol/rast-prod/jobs/$rast_job/rp";
    opendir(D,$jobD) || die $jobD;
    my @tmp = grep { $_ =~ /^\d+\.\d+$/ } readdir(D);
    closedir(D);
    my $genome = $tmp[0];
    print OUT join("\t",(@flds,$genome)),"\n";
}
close(OUT);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3