[Bio] / FigWebServices / SimBlockPattern.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/SimBlockPattern.cgi

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

revision 1.2, Fri Jun 10 06:21:14 2005 UTC revision 1.5, Fri Jul 28 02:07:28 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    #
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    
20  BEGIN {  BEGIN {
21      # Print the HTML header.      # Print the HTML header.
# Line 19  Line 36 
36  record.  record.
37    
38  For debugging purposes, you can specify the B<Trace> parameter to  For debugging purposes, you can specify the B<Trace> parameter to
39  set the tracing level. You can also set the B<ShowMode> parameter to  set the tracing level. So, for example,
 C<1> to display a table of the parameters passed by the form. So,  
 for example,  
40    
41  C<< http://myseedurl/CGI/SimBlockPattern.cgi?Trace=3 >>  C<< http://myseedurl/CGI/SimBlockPattern.cgi?Trace=3 >>
42    
# Line 42  Line 57 
57  use PageBuilder;  use PageBuilder;
58  use SimBlocks;  use SimBlocks;
59    
60  # Get the CGI parameters.  # Get the CGI parameters and set up the variable hash.
61  my $query = new CGI;  my ($query, $varHash) = ScriptSetup();
62  my $traceLevel = $query->param("Trace");  # Do this next part safely.
63  if (!defined $traceLevel || length $traceLevel == 0) {  eval {
     $traceLevel = "0";  
 }  
 TSetup("$traceLevel Tracer", "QUEUE");  
   
64  # Our first task is to get the parameters. We need a list of the IDs of the selected  # Our first task is to get the parameters. We need a list of the IDs of the selected
65  # genomes. These lists will be found in the "set0Genomes" and "set1Genomes" parameters.  # genomes. These lists will be found in the "set0Genomes" and "set1Genomes" parameters.
66    
# Line 69  Line 80 
80  }  }
81  Trace("Block $blockID selected for genomes " . join ", ", @genomes) if T(2);  Trace("Block $blockID selected for genomes " . join ", ", @genomes) if T(2);
82  # Now we have all the information we need to produce the alignment. We need to  # Now we have all the information we need to produce the alignment. We need to
83  # create the similarity block object and start the web page.      # create the similarity block object and start the big block in the middle of
84        # the web page.
85  my $simBlock = SimBlocks->new();  my $simBlock = SimBlocks->new();
86  my $builder = PageBuilder::new("Html/SimBlockPattern.html", {}, "Html");      my $webData = "";
 # Protect against errors.  
 eval {  
87      # Next we need the template fragment for the rows.      # Next we need the template fragment for the rows.
88      my $rowFragment = Tracer::GetFile("Html/SimBlockPatternRow.html");      my $rowFragment = Tracer::GetFile("Html/SimBlockPatternRow.html");
89      # Get the block from the similarity block database and extract its pattern.      # Get the block from the similarity block database and extract its pattern.
# Line 90  Line 100 
100          # Create a table row for this region.          # Create a table row for this region.
101          my $row = PageBuilder::Build($rowFragment, { region => $region, dna => $dna,          my $row = PageBuilder::Build($rowFragment, { region => $region, dna => $dna,
102                                                       setNumber => $setNumber }, "Html");                                                       setNumber => $setNumber }, "Html");
103          print $row;          $webData .= $row;
104      }      }
105      # Now we need to create the snip list. The snip list is a column-oriented      # Now we need to create the snip list. The snip list is a column-oriented
106      # table (that is, each data item is in a separate column), so we we will      # table (that is, each data item is in a separate column), so we we will
# Line 113  Line 123 
123      my $set0Row = join "</td><td>", @set0Data;      my $set0Row = join "</td><td>", @set0Data;
124      my $set1Row = join "</td><td>", @set1Data;      my $set1Row = join "</td><td>", @set1Data;
125      # Plug them into the fragment and write it out.      # Plug them into the fragment and write it out.
126      my $snipData = PageBuilder::Build("<Html/SimBlockSnipFragment.html",      my $snipData = PageBuilder::Build("<<Html/SimBlockSnipFragment.html",
127                                        { positionRow => $positionRow, set0Row => $set0Row,                                        { positionRow => $positionRow, set0Row => $set0Row,
128                                          set1Row => $set1Row }, "Html");                                          set1Row => $set1Row }, "Html");
129      print $snipData;      $webData .= $snipData;
130        # Put the web page data into the variable hash.
131        $varHash->{Data} = $webData;
132  };  };
133  # Trace any error that occurred.  # Trace any error that occurred.
134  if ($@) {  if ($@) {
135      Trace($@) if T(0);      Trace($@) if T(0);
136  }  }
137  # Write out any trace messages.  # Write out the web page.
138  my $qtrace = QTrace("html");  ScriptFinish("Html/SimBlockPattern.html", $varHash);
 print $qtrace;  
 # Finish the web page.  
 $builder->Finish();  
139    
140  1;  1;

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3