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

View of /FigKernelScripts/sort_and_split_bbhs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Jun 8 23:05:21 2005 UTC (14 years, 7 months ago) by overbeek
Branch: MAIN
major change to BBHs (use precomputed)

#!/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/bin/perl

BEGIN {
    @INC = qw(
	/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/5.8.4/darwin-2level
	/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/5.8.4
	/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/site_perl/5.8.4/darwin-2level
	/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/site_perl/5.8.4
	/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/site_perl
);
}
use Data::Dumper;
use Carp;
# Following block is expanded by switch_to_release to add use lib directives
# to point at the correct locations in the release directory.
#BEGIN switch_to_release generated code
use lib '/Volumes/FIGdisk/FIGdisk.Nov20/dist/releases/ross/mac/lib';
use lib '/Volumes/FIGdisk/FIGdisk.Nov20/dist/releases/ross/mac/lib/FigKernelPackages';
$ENV{PATH} = "/Volumes/FIGdisk/FIGdisk.Nov20/FIG/bin:/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/bin:$ENV{PATH}";
$ENV{BLASTMAT} = "/Volumes/FIGdisk/FIGdisk.Nov20/BLASTMAT";
#END switch_to_release generated code

use lib "/Volumes/FIGdisk/FIGdisk.Nov20/config";
use FIG_Config;

#### END tool_hdr ####
use FIG;

$usage = "usage: sort_and_split_bbhs BBHs Dir";

(
 ($bbhs = shift @ARGV) &&
 ($dir  = shift @ARGV)
)
    || die $usage;

&FIG::verify_dir($dir);

open(BBHS,"sort -u $bbhs |") || die "could not open $bbhs";
$last = "";
$bbh = <BBHS>;
while ($bbh && ($bbh =~ /^(\S+)/))
{
    $curr = $1;
    if (($genome = &FIG::genome_of($curr)) ne $last)
    {
	if ($last)
	{
	    close(BYGENOME);
	}
	$last = $genome;
	open(BYGENOME,">$dir/$genome") || die "could not open $dir/$genome";
    }
    while ($bbh && ($bbh =~ /^(\S+)/) && ($1 eq $curr))
    {
	print BYGENOME $bbh;
	$bbh = <BBHS>;
    }
}
close(BYGENOME);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3