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

View of /FigKernelScripts/pg_process_pubs.pl

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.1 - (download) (as text) (annotate)
Wed Apr 10 19:15:29 2013 UTC (6 years, 7 months ago) by olson
Branch: MAIN
CVS Tags: rast_rel_2014_0729, rast_rel_2014_0912, HEAD
Modifications to pangenome code to move common code to PG.pm.

use strict;
use Data::Dumper;
use SeedUtils;
use Getopt::Long;
use FIGM;
use DB_File;
use JSON::XS;

my $usage = "usage: pg_process_pubs -d Data < pubs-file\n";
my $dataD;
my $rc  = GetOptions('d=s' => \$dataD,);

if ((! $rc) || (! -d $dataD)) { print STDERR $usage; exit }

my $jobs = "/vol/rast-prod/jobs";

open(G, "<", "$dataD/genomes.with.job.and.genomeID") or die "cannot open $dataD/genomes.with.job.and.genomeID: $!";
my(@genomes, @dirs);
my %genomes;
my %tags;
while (<G>)
    my($n, $orig, $rast, $genome) = split(/\t/);
    push(@genomes, $genome);
    push(@dirs, "$jobs/$rast/rp/$genome");


my $fig = FIGM->new(undef, @dirs);

open(L, "<", "$dataD/locus.tags") or die "cannot open locus tags: $!\n";

my %locus;
while (<L>)
    my($tag, $peg) = split(/\t/);
    push(@{$locus{$tag}}, $peg);

while (<STDIN>)

    my($name, $locus, $desc, $pubmed, $quote) = split(/\t/);

    $locus =~ s/\s+//g;

    my $l = $locus{$locus};
    if ($l)
	my($pid) = $pubmed =~ /(\d+)/;
	$desc =~ s/\"//g;
	print join("\t", $name, $locus, join(",", @$l), $desc, $pid), "\n";
	print STDERR "$locus\n";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3