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

Annotation of /FigKernelScripts/package_assignments.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : efrank 1.1 # -*- perl -*-
2 : olson 1.8 #
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 use Carp;
20 :     use Data::Dumper;
21 :     use P2Pupdate;
22 :    
23 :     use FIG;
24 :     my $fig = new FIG;
25 :    
26 : overbeek 1.6 # usage: package_assignments AssignmentsPackage user=User [who=Who] date=Date [G1 G2 ...]
27 : efrank 1.1
28 : olson 1.7 sub usage
29 :     {
30 :     die "Usage: $0 AssignmentsPackage user=User [who=Who] date=Date [G1 G2 ...]\n";
31 :     }
32 :    
33 : efrank 1.3 my $package = shift @ARGV;
34 :    
35 : overbeek 1.2 my $who = "";
36 :     my $date = "";
37 : overbeek 1.5 my $user = "";
38 : efrank 1.1
39 : overbeek 1.2 my $arg;
40 :     my @genomes = ();
41 : overbeek 1.5
42 : overbeek 1.2 foreach $arg (@ARGV)
43 : efrank 1.1 {
44 : overbeek 1.2 if ($arg =~ /^who=(\S+)/)
45 :     {
46 :     $who = $1;
47 :     }
48 :     elsif ($arg =~ /^date=(\S+)/)
49 :     {
50 :     $date = $1;
51 :     }
52 : overbeek 1.5 elsif ($arg =~ /^user=(\S+)/)
53 :     {
54 :     $user = $1;
55 :     }
56 : overbeek 1.2 else
57 :     {
58 :     push(@genomes,$arg);
59 :     }
60 :     }
61 :    
62 : overbeek 1.5 if (! $user)
63 :     {
64 : olson 1.7 &usage;
65 : overbeek 1.5 }
66 :    
67 : overbeek 1.6 if (! $date)
68 :     {
69 : olson 1.7 &usage;
70 : overbeek 1.6 }
71 :    
72 :     $who = $who ? $who : "master";
73 :    
74 : overbeek 1.2 if (@genomes > 0)
75 :     {
76 :     $genomes = \@genomes;
77 : efrank 1.1 }
78 :     else
79 :     {
80 :     $genomes = [$fig->genomes];
81 :     }
82 :    
83 : overbeek 1.5 &P2Pupdate::package_assignments($fig,$user,$who,$date,$genomes,$package);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3