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

Annotation of /FigKernelScripts/sort_and_split_bbhs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : overbeek 1.1 #!/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/bin/perl
2 :    
3 :     BEGIN {
4 :     @INC = qw(
5 :     /Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/5.8.4/darwin-2level
6 :     /Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/5.8.4
7 :     /Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/site_perl/5.8.4/darwin-2level
8 :     /Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/site_perl/5.8.4
9 :     /Volumes/FIGdisk/FIGdisk.Nov20/env/mac/lib/perl5/site_perl
10 :     );
11 :     }
12 :     use Data::Dumper;
13 :     use Carp;
14 :     # Following block is expanded by switch_to_release to add use lib directives
15 :     # to point at the correct locations in the release directory.
16 :     #BEGIN switch_to_release generated code
17 :     use lib '/Volumes/FIGdisk/FIGdisk.Nov20/dist/releases/ross/mac/lib';
18 :     use lib '/Volumes/FIGdisk/FIGdisk.Nov20/dist/releases/ross/mac/lib/FigKernelPackages';
19 :     $ENV{PATH} = "/Volumes/FIGdisk/FIGdisk.Nov20/FIG/bin:/Volumes/FIGdisk/FIGdisk.Nov20/env/mac/bin:$ENV{PATH}";
20 :     $ENV{BLASTMAT} = "/Volumes/FIGdisk/FIGdisk.Nov20/BLASTMAT";
21 :     #END switch_to_release generated code
22 :    
23 :     use lib "/Volumes/FIGdisk/FIGdisk.Nov20/config";
24 :     use FIG_Config;
25 :    
26 :     #### END tool_hdr ####
27 :     use FIG;
28 :    
29 :     $usage = "usage: sort_and_split_bbhs BBHs Dir";
30 :    
31 :     (
32 :     ($bbhs = shift @ARGV) &&
33 :     ($dir = shift @ARGV)
34 :     )
35 :     || die $usage;
36 :    
37 :     &FIG::verify_dir($dir);
38 :    
39 :     open(BBHS,"sort -u $bbhs |") || die "could not open $bbhs";
40 :     $last = "";
41 :     $bbh = <BBHS>;
42 :     while ($bbh && ($bbh =~ /^(\S+)/))
43 :     {
44 :     $curr = $1;
45 :     if (($genome = &FIG::genome_of($curr)) ne $last)
46 :     {
47 :     if ($last)
48 :     {
49 :     close(BYGENOME);
50 :     }
51 :     $last = $genome;
52 :     open(BYGENOME,">$dir/$genome") || die "could not open $dir/$genome";
53 :     }
54 :     while ($bbh && ($bbh =~ /^(\S+)/) && ($1 eq $curr))
55 :     {
56 :     print BYGENOME $bbh;
57 :     $bbh = <BBHS>;
58 :     }
59 :     }
60 :     close(BYGENOME);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3