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

Annotation of /FigWebServices/SimPieces.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download)

1 : parrello 1.1 #!/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 {
21 :     # Print the HTML header.
22 :     print "CONTENT-TYPE: text/html\n\n";
23 :     }
24 :    
25 :     =head1 Similarity Block Piece Display
26 :    
27 :     This script processes input from the C<SimBlockForm.cgi> script's web page and
28 :     produces a list of similarity block pieces that are within a specified distance
29 :     if the specified feature.
30 :    
31 :     For debugging purposes, you can specify the B<Trace> parameter to
32 :     set the tracing level. So, for example,
33 :    
34 :     C<< http://myseedurl/CGI/SimPieces.cgi?Trace=3 >>
35 :    
36 :     runs the standard processing script at a trace level of 3. Normally, only the
37 :     script itself and B<Tracer> tracing is active; however, you can activate other tracing modules
38 :     by appending them to the trace level. Thus,
39 :    
40 :     C<< http://myseedurl/CGI/SimPieces.cgi?Trace=3%20SimBlocks%20DBObject >>
41 :    
42 :     activates tracing for the similarity block module (C<SimBlocks.pm>) and the data
43 :     base object (C<DBObject.pm>).
44 :    
45 :     =cut
46 :    
47 :     use strict;
48 :     use CGI;
49 :     use Tracer;
50 :     use PageBuilder;
51 :     use SimBlocks;
52 :    
53 :     # Set up this script.
54 :     my ($query, $varHash) = ScriptSetup();
55 :     # Do this next part safely.
56 :     eval {
57 :     # Get the incoming feature ID and the distance.
58 :     my $featureID = $query->param("Feature");
59 :     my $distance = $query->param("Distance");
60 :     $varHash->{distance} = $distance;
61 :     $varHash->{source} = $featureID;
62 :     # Get the similarity block and FIG objects.
63 :     my $fig = FIG->new();
64 :     my $simdb = SimBlocks->new();
65 :     # Get the list of pieces.
66 :     my @pieces = $simdb->GetFeatureBlockPieces($fig, [$featureID], $distance);
67 :     # Now we build the rows into a single string using the SimBlockPiecesFragment
68 :     # template.
69 :     my $template = Tracer::GetFile("Html/SimBlockPiecesFragment.html");
70 :     my $rows = "";
71 :     for my $piece (@pieces) {
72 :     $rows .= PageBuilder::Build($template,
73 :     { blockID => $piece->Contig,
74 :     start => $piece->Left,
75 :     end => $piece->Right,
76 :     len => $piece->Length },
77 :     "Html");
78 :     }
79 :     # Put all this data into the variable hash.
80 :     $varHash->{rows} = $rows;
81 :     };
82 :     # Check for an error from the EVAL.
83 :     if ($@) {
84 :     Trace("Script error: $@") if T(0);
85 :     }
86 :     ScriptFinish("Html/SimBlockPieces.html", $varHash);
87 :    
88 :    
89 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3