#!/usr/bin/perl -w

use strict;
use lib "/usr2/people/khuang/bin/Genomics/Perl/modules";
use Genome;
use Scaffold;
use GenomicsUtils;

connect("lut");

my $sql = qq{
    SELECT distinct(taxonomyId)
	FROM Scaffold
	WHERE isGenomic=1
	ORDER BY taxonomyId
};
my $taxR = GenomicsUtils::query($sql);
foreach (@$taxR){
    my $genome = Genome::new(taxonomyId=>$_->[0]);
    my @genes = $genome->genes();
    foreach my $gene (@genes){
	print ">VIMSS",$gene->locusId()," ",$gene->descriptionRef()->[0]," ",$genome->name(), "\n";
	print $gene->protein(),"\n";

    }

}

disconnect();
exit;
