[Bio] / FigKernelScripts / p3x-check-mcl-compute-times.pl Repository:
ViewVC logotype

View of /FigKernelScripts/p3x-check-mcl-compute-times.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Nov 2 16:25:31 2016 UTC (3 years ago) by olson
Branch: MAIN
CVS Tags: HEAD
P3 utility scripts.

#
# Scan a genus directory to find the time lag between creation of dist file and creation of mcl output file.
# Emit data that includes the original fasta file size and the number of entries in the dist file.
#

use strict;

my $dir = shift;

opendir(D, "$dir/families.mcl") or die "cannot opendir $dir: $!";

while (my $fam = readdir(D))
{
    next unless $fam =~ /^LFIG\d+$/;
    my @fa_stat = stat("$dir/families.fasta/$fam");
    my @dist_stat = stat("$dir/families.dist/$fam");
    my @mcl_stat =  stat("$dir/families.mcl/$fam");

    @dist_stat or next;

    my $fa_size = $fa_stat[7];
    my $dist_mod = $dist_stat[9];
    my $mcl_mod = $mcl_stat[9];
    my $elap = $mcl_mod - $dist_mod;
    open(DIST, "<", "$dir/families.dist/$fam") or die "Cannot open $dir/families.dist/$fam: $!";
    my $n;
    while (<DIST>)
    {
	$n++;
    }
    close(DIST);
    print join("\t", $fam, $fa_size, $n, $elap), "\n";
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3