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

Annotation of /FigKernelScripts/load_external_orgs.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : efrank 1.1 # -*- perl -*-
2 : olson 1.3 #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 :     #
8 :     # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 :     # Public License.
11 :     #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :    
19 : efrank 1.1
20 :     ###########################################
21 :     use strict;
22 :     use FIG;
23 : parrello 1.2 use Tracer;
24 : efrank 1.1
25 :     my $fig = new FIG;
26 :    
27 :     my($temp_dir,$prot,$org);
28 :    
29 :     # usage: load_extaernal_orgs
30 :    
31 :    
32 :     $temp_dir = $FIG_Config::temp;
33 : parrello 1.2 my $orgFile = "$temp_dir/tmp$$";
34 :     Open(\*TAB, ">$orgFile");
35 :     Open(\*SPORG, "<$FIG_Config::global/ext_org.table");
36 :     Trace("Copying external organism file.") if T(2);
37 :     while (defined($_ = <SPORG>)) {
38 : efrank 1.1 chop;
39 :     ($prot,$org) = split(/\t/,$_);
40 : parrello 1.2 if (defined($prot) && defined($org) && (length($org) < 64)) {
41 :     print TAB "$prot\t$org\n";
42 : efrank 1.1 }
43 :     }
44 :     close(TAB);
45 :     close(SPORG);
46 :    
47 : parrello 1.2 $fig->reload_table('all', "external_orgs",
48 :     "prot varchar(32), org varchar(64)",
49 :     { external_orgs_ix => "prot" },
50 :     $orgFile);
51 :     unlink($orgFile);
52 :     Trace("External organisms loaded.") if T(2);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3