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

Annotation of /FigKernelScripts/make_sprout_bbhs.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.2 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : overbeek 1.1
19 :    
20 :     my $usage = "usage: make_sprout_bbhs GenomesFile > PEG1-PEG2-Genome2-Sc";
21 :    
22 :     (
23 :     ($genomesF = shift @ARGV)
24 :     )
25 :     || die $usage;
26 :    
27 :     %genomes = map { $_ =~ /^(\d+\.\d+)/; $1 => 1 } `cat $genomesF`;
28 :    
29 :     opendir(BBHS,"$FIG_Config::global/BBHs") || die "where are the BBHs?";
30 :     @files = grep { $_ !~ /^\./ } readdir(BBHS);
31 :     closedir(BBHS);
32 :    
33 :     foreach $file (@files)
34 :     {
35 :     open(IN,"<$FIG_Config::global/BBHs/$file") || die "could not open $FIG_Config::global/BBHs/$file";
36 :     while (defined($_ = <IN>))
37 :     {
38 :     if (($_ =~ /^(fig\|(\d+\.\d+)\.peg\.\d+)\t(fig\|(\d+\.\d+)\.peg\.\d+)\t(\S+)/) &&
39 :     $genomes{$2} && $genomes{$4})
40 :     {
41 :     print "$1\t$3\t$4\t$5\n";
42 :     }
43 :     }
44 :     close(IN);
45 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3