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

View of /FigKernelScripts/FFB2_install_kmers.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Fri Oct 29 17:10:34 2010 UTC (9 years ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, myrast_rel40, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2011_0119, 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, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011, HEAD
Changes since 1.1: +11 -3 lines
Update to FF processing

#
# Install the generated Kmers into the specified data directory.
#


use strict;
use File::Basename;

@ARGV == 2 or die "$0 figfam-dir destination-dir\n";

my $ff_dir = shift;
my $dest_dir = shift;

-d $dest_dir or die "destination $dest_dir does not exist\n";

my $rel = basename($ff_dir);
$rel =~ /Release\S+/ or die "invalid ff_dir name\n";

mkdir "$dest_dir/$rel" or die "Cannot mkdir $dest_dir/$rel: $!";

my %optional = ('md5.figfams' => 1);
my @top_files = qw(FRI.db extra_prok_seqs.fasta families.2c family.functions function.index md5.figfams setI.db);
for my $f (@top_files)
{
    print "Copy $f\n";
    eval {
	run("/bin/cp", "$ff_dir/$f", "$dest_dir/$rel/$f");
    };
    
    if ($@ && !$optional{$f})
    {
	die "error on copy: $@";
    }
}

#
# and the formatdb output
#
for my $f (<$ff_dir/extra_prok_seqs.fasta*>)
{
    print "Copy $f\n";
    run("/bin/cp", $f, "$dest_dir/$rel/.");
}

mkdir("$dest_dir/$rel/binary");
for my $kdir (<$ff_dir/Merged/*>)
{
    my $k = basename($kdir);

    print "Copy $kdir/table.binary\n";
    run("/bin/cp", "$kdir/table.binary", "$dest_dir/$rel/binary/table.binary.$k");
}


sub run
{
    my(@cmd) = @_;
    my $rc = system(@cmd);
    if ($rc != 0)
    {
	die "Error $rc running @cmd\n";
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3