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

Annotation of /FigWebServices/SimBlockForm.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (view) (download)

1 : parrello 1.1 #!/usr/bin/perl -w
2 : olson 1.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 : parrello 1.6 #
8 : olson 1.2 # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 : parrello 1.6 # Public License.
11 : olson 1.2 #
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 : parrello 1.1
20 :     BEGIN {
21 :     # Print the HTML header.
22 :     print "CONTENT-TYPE: text/html\n\n";
23 :     }
24 :    
25 :     =head1 Similarity Block Form Generator
26 :    
27 :     This script generates the form used to request similarity comparisons
28 :     between genome sets. The form allows the user to select which of the
29 :     available genomes should be put in each set. When the form is
30 :     submitted, the processing script will invoke the B<Compare> method
31 :     of the B<SimBlocks> object to generate a comparison summary.
32 :    
33 :     For debugging purposes, you can specify the B<Trace> parameter to
34 : parrello 1.3 set the tracing level. So, for example,
35 : parrello 1.1
36 : parrello 1.6 http://myseedurl/CGI/SimBlockForm.cgi?Trace=3
37 : parrello 1.1
38 :     runs the standard processing script at a trace level of 3. Normally, only the
39 :     script itself and B<Tracer> tracing is active; however, you can activate other tracing modules
40 :     by appending them to the trace level. Thus,
41 :    
42 : parrello 1.6 http://myseedurl/CGI/SimBlockForm.cgi?Trace=3%20SimBlocks%20ERDBObject
43 : parrello 1.1
44 :     activates tracing for the similarity block module (C<SimBlocks.pm>) and the data
45 : parrello 1.5 base object (C<ERDBObject.pm>).
46 : parrello 1.1
47 :     =cut
48 :    
49 :     use strict;
50 :     use CGI;
51 :     use Tracer;
52 :     use PageBuilder;
53 :     use SimBlocks;
54 :    
55 : parrello 1.7 my ($query, $varHash) = Tracer::ScriptSetup();
56 : parrello 1.3 eval {
57 :     # Create the similarity block object.
58 :     my $simBlocks = SimBlocks->new();
59 :     # Begin building the main part of the output page.
60 :     my $webData = "";
61 :     # We intend to loop through the genomes, generating a table row for each.
62 :     # The table row is built from a template string in the
63 :     # SimBlockGenomeFragment.html file.
64 :     my $rowTemplate = Tracer::GetFile("Html/SimBlockGenomeFragment.html");
65 :     # Create a hash to use for the template variables in the genome row.
66 :     my %varHash = ( GenomeID => "error", GenomeDescription => "error");
67 :     # Now we get the genome list from the database.
68 : parrello 1.4 my @genomes = $simBlocks->GetList(['Genome'], "ORDER BY Genome(group-name), Genome(id)");
69 : parrello 1.3 # Loop through the genomes, generating table rows.
70 :     for my $genome (@genomes) {
71 :     # Copy the genome fields into the variable hash.
72 :     ($varHash{GenomeID}, $varHash{GenomeDescription}) =
73 :     $genome->Values(['Genome(id)', 'Genome(description)']);
74 :     # Substitute the variables and write them out.
75 :     my $row = PageBuilder::Build($rowTemplate, \%varHash);
76 :     $webData .= $row;
77 :     }
78 :     # Store the page data.
79 :     $varHash->{Data} = $webData;
80 :     };
81 :     # Trace any error that occurred.
82 :     if ($@) {
83 :     Trace($@) if T(0);
84 : parrello 1.1 }
85 : parrello 1.3 # Write out the web page.
86 :     Tracer::ScriptFinish("Html/SimBlockForm.html", $varHash);
87 : parrello 1.1
88 : parrello 1.6 1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3