[Bio] / FigKernelPackages / FIG_CGI.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG_CGI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5, Sat Aug 5 03:10:01 2006 UTC revision 1.9, Tue Apr 29 05:30:45 2008 UTC
# Line 35  Line 35 
35    
36  use strict;  use strict;
37  use FIG;  use FIG;
38    use FIGV;
39  use FIG_Config;  use FIG_Config;
40  use CGI;  use CGI;
41  use Data::Dumper;  use Data::Dumper;
# Line 44  Line 45 
45    
46  =head3 init  =head3 init
47    
48  C<< my($fig, $cgi, $user) = FIG_CGI::init(debug_save => 0, debug_load => 0, print_params => 0); >>      my($fig, $cgi, $user) = FIG_CGI::init(debug_save => 0, debug_load => 0, print_params => 0);
49    
50  Initialize a FIG and CGI object for use in the CGI script. Depending on the  Initialize a FIG and CGI object for use in the CGI script. Depending on the
51  CGI parameters passed in, the FIG object will be either an actual FIG object  CGI parameters passed in, the FIG object will be either an actual FIG object
# Line 85  Line 86 
86      # Get the CGI and FIG objects.      # Get the CGI and FIG objects.
87      my $cgi = new CGI;      my $cgi = new CGI;
88      my $fig = init_fig($cgi);      my $fig = init_fig($cgi);
89        # Turn on tracing.
90        ETracing($cgi);
91      # If we're debugging, we need to know which file is to receive the debugging      # If we're debugging, we need to know which file is to receive the debugging
92      # information.      # information.
93      my $script_name = determine_script_name();      my $script_name = determine_script_name();
# Line 125  Line 128 
128    
129  =head3 is_sprout  =head3 is_sprout
130    
131  C<< my $flag = is_sprout($object); >>      my $flag = is_sprout($object);
132    
133  Return TRUE if we are running in Sprout mode, else FALSE.  Return TRUE if we are running in Sprout mode, else FALSE.
134    
# Line 157  Line 160 
160      if ($type eq 'SFXlate') {      if ($type eq 'SFXlate') {
161          $retVal = 1;          $retVal = 1;
162      } elsif ($type eq 'CGI') {      } elsif ($type eq 'CGI') {
163          $retVal = $object->param('SPROUT');          $retVal = FIGRules::nmpdr_mode($object);
164      }      }
165      # Return the result.      # Return the result.
166      return $retVal;      return $retVal;
# Line 165  Line 168 
168    
169  sub init_tracing  sub init_tracing
170  {  {
171      my($cgi) = @_;      # DEPRECATED: ETracing is used instead.
     my $traceData = $cgi->param('trace');  
     if ($traceData) {  
         TSetup($traceData, "QUEUE");  
         $traceData = 1;  
     } else {  
         TSetup(0, "NONE");  
         $traceData = 0;  
     }  
172  }  }
173    
174  sub init_fig  sub init_fig
# Line 181  Line 176 
176      my($cgi) = @_;      my($cgi) = @_;
177    
178      my $fig;      my $fig;
179      if ($cgi->param('SPROUT'))      if (FIGRules::nmpdr_mode($cgi))
180      {      {
181          $fig = new SproutFIG($FIG_Config::sproutDB, $FIG_Config::sproutData);          $fig = new SproutFIG($FIG_Config::sproutDB, $FIG_Config::sproutData);
182      }      }
183      else      else
184      {      {
185            if (my $job = $cgi->param("48hr_job"))
186            {
187                my $jobdir = "/vol/48-hour/Jobs/$job";
188                my $genome = &FIG::file_head("$jobdir/GENOME_ID");
189                chomp $genome;
190                if ($genome !~ /^\d+\.\d+/)
191                {
192                    die "Cannnot find genome ID for jobdir $jobdir\n";
193                }
194                my $orgdir = "$jobdir/rp/$genome";
195                if (! -d $orgdir)
196                {
197                    die "Cannot find orgdir $orgdir\n";
198                }
199                $fig = new FIGV($orgdir);
200            }
201            else
202            {
203          $fig = new FIG;          $fig = new FIG;
204      }      }
205        }
206      return $fig;      return $fig;
207  }  }
208    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3