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

Annotation of /FigKernelScripts/check_for_unique_sims.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 : efrank 1.1
19 :     # usage: check_for_unique_sims Dir
20 :    
21 :     ($dir = shift @ARGV)
22 :     || die "usage: check_for_unique_sims Dir";
23 :    
24 :     opendir(DIR,$dir)
25 :     || die "usage: check_for_unique_sims Dir";
26 :     @files = grep { $_ !~ /^\./ } readdir(DIR);
27 :     closedir(DIR);
28 :    
29 :     for ($i=0; ($i < @files); $i++)
30 :     {
31 :     $file = $files[$i];
32 :     print STDERR "processing $file\n";
33 :    
34 :     open(FILE,"<$dir/$file")
35 :     || die "could not open $dir/$file";
36 :    
37 :     $_ = <FILE>;
38 :     while ($_ && ($_ =~ /^(\S+)/))
39 :     {
40 :     $curr = $1;
41 :     $currQ = quotemeta $curr;
42 :     while ($_ && ($_ =~ /^$currQ\t/))
43 :     {
44 :     $_ = <FILE>;
45 :     }
46 :    
47 :     if ($seen{$curr})
48 :     {
49 :     print STDERR "$curr\t$files[$seen{$curr}]\t$file\n";
50 :     }
51 :     else
52 :     {
53 :     $seen{$curr} = $i;
54 :     $n++;
55 :     }
56 :     }
57 :    
58 :     if ($_)
59 :     {
60 :     print STDERR "BAD: $file\t$_";
61 :     }
62 :     close(FILE);
63 :     }
64 :    
65 :     print "total id1s = $n\n";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3