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

View of /FigKernelScripts/figfam_quality_control.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (download) (as text) (annotate)
Thu Oct 8 18:52:15 2009 UTC (10 years, 4 months ago) by arodri7
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, myrast_rel40, mgrast_dev_05262011, mgrast_dev_04082011, rast_rel_2010_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, rast_rel_2010_0526, rast_rel_2014_0729, mgrast_dev_02212011, rast_rel_2010_1206, mgrast_release_3_0, mgrast_dev_03252011, rast_rel_2010_0118, 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, rast_rel_2010_0827, myrast_33, rast_rel_2011_0928, mgrast_dev_04052011, mgrast_dev_02222011, mgrast_dev_10262011, HEAD
Changes since 1.7: +25 -6 lines
commit changes

#!/usr/bin/env /home/arodri7/FIGdisk/bin/run_perl

use Data::Dumper;
use Carp;
use FIG_Config;
use FIG;

my $usage = "figfam_quality_control -f figfam_version_directory\n";
my ($ffD, $kmers, $workD);
while ( $ARGV[0] =~ /^-/ ) {
    $_ = shift @ARGV;
    if    ($_ =~ s/^-f//) { $ffD       = ($_ || shift @ARGV) }
    elsif ($_ =~ s/^-w//) { $workD     = ($_ || shift @ARGV) }
    elsif ($_ =~ s/^-k//) { $kmers     = 1 }
    else                  { print STDERR  "Bad flag: '$_'\n$usage"; exit 1 }
}

if (! $ffD) {
    $ffD = &FIG::get_figfams_data();
}

my $genomesTest = {};

$genomesTest->{1148.1} = 1;
$genomesTest->{224308.1} = 1;
$genomesTest->{83333.1} = 1;
$genomesTest->{243273.1} = 1;
$genomesTest->{158879.1} = 1;
$genomesTest->{198466.1} = 1;
$genomesTest->{169963.1} = 1;
$genomesTest->{192222.1} = 1;
$genomesTest->{243277.1} = 1;


if (! $workD)
{
    $workD = "$ffD/quality_control";
}

my @genomes = sort { $a <=> $b } keys(%$genomesTest);

foreach my $genome (@genomes)
{
    my @procs = &start_procs($ffD,"$workD",[$genome],$kmers);
    &close_procs(\@procs);
}


######
# Gather statistics about the release
#
#######
&FIG::run("figfam_size_distribution $ffD > $ffD/release_history/size_distribution.dat");
&FIG::run("figfam_subsystems $ffD > $ffD/release_history/figfam_subsystem.dat");
&FIG::run("get_FIGfams_SS_NMPDR_stats $ffD/families.2c > $ffD/release_history/release_genomes.stats");
&FIG::run("cleanup_figfams_updates $ffd");

sub start_procs {
    my($ffD,$outD,$genomes,$kmers) = @_;

    my @procs = ();
    my $i;
    for ($i=0; ($i < @$genomes); $i++)
    {
	my $name = "PROC$i";
	open($name,"| submit_ff_test $ffD $genomes->[$i] $outD $kmers");
	print $name $genomes->[$i];
	push(@procs,\*$name);
	my $ofh = select $name; $| = 1; select $ofh;
    }

    return @procs;
}

sub close_procs {
    my($procs) = @_;
    my $proc;

    for (my $i=0; ($i < @$procs); $i++)
    {
	my $fh = $procs->[$i];
	close($fh);
    }
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3