30 |
one of the columns and click the appropriate button to generate an alignment |
one of the columns and click the appropriate button to generate an alignment |
31 |
display in the embedded frame below the block lists. |
display in the embedded frame below the block lists. |
32 |
|
|
33 |
For debugging purposes, you can specify the B<Trace> parameter to |
Common blocks will be displayed in red if they have snip differences. A I<snip |
34 |
set the tracing level. You can also set the B<ShowMode> parameter to |
difference> is a column in which the contents for set 0 are different from the |
35 |
C<1> to display a table of the parameters passed by the form. So, |
contents for set 1. So, for example, if column 6 is always A or G for set 0 and |
36 |
for example, |
always T for set 1, there is a snip difference. The snip difference is therefore |
37 |
|
a much stronger condition than merely having different values in a column. If |
38 |
C<< http://myseedurl/CGI/SimBlockDisplay.cgi?ShowMode=1 >> |
column 6 contained A and G in set 0 and only A in set 1, it would not be a snip |
39 |
|
difference, because A occurs in both sets. |
40 |
|
|
41 |
|
When a block is selected for display in the lower part of the form, the snip |
42 |
|
differences are shown in a table. Therefore, that table will be empty unless |
43 |
|
the block name is displayed in red. |
44 |
|
|
45 |
|
At the bottom of the page, an alignment of the snips in the common blocks |
46 |
|
is displayed. If this alignment is sufficiently large, it will not show up |
47 |
|
properly in Firefox. |
48 |
|
|
49 |
will set the form action to display the form contents without processing |
For debugging purposes, you can specify the B<Trace> parameter to |
50 |
them, while |
set the tracing level. So, for example, |
51 |
|
|
52 |
C<< http://myseedurl/CGI/SimBlockDisplay.cgi?Trace=3 >> |
C<< http://myseedurl/CGI/SimBlockDisplay.cgi?Trace=3 >> |
53 |
|
|
69 |
use SimBlocks; |
use SimBlocks; |
70 |
|
|
71 |
# Get the CGI parameters. |
# Get the CGI parameters. |
72 |
my $query = new CGI; |
my ($query, $varHash) = ScriptSetup(); |
73 |
my $traceLevel = $query->param("Trace"); |
# Do this next part safely. |
74 |
if (!defined $traceLevel || length $traceLevel == 0) { |
eval { |
|
$traceLevel = 0; |
|
|
} |
|
|
TSetup("$traceLevel Tracer", "QUEUE"); |
|
|
# Choose the output script based on the ShowMode parameter. |
|
|
my $script = ($query->param('ShowMode') ? 'FormDisplay' : 'SimBlockPattern'); |
|
|
# Decide whether or not we need debugging fields. |
|
|
my $traceFields = (Tracer::DebugMode() ? Tracer::GetFile("Html/DebugFragment.html") : ""); |
|
|
# Create the variable hash used to generate the web page. We start with the debug-related |
|
|
# fields we've already computed. |
|
|
my %varHash = ( script => $script, DebugData => $traceFields ); |
|
75 |
# Next we get the list of genomes in each set. These come from the radio |
# Next we get the list of genomes in each set. These come from the radio |
76 |
# buttons on the incoming form. Basically, we look for any option whose value |
# buttons on the incoming form. Basically, we look for any option whose value |
77 |
# is "set0" or "set1", and put it in the appropriate list. To make this process |
# is "set0" or "set1", and put it in the appropriate list. To make this process |
99 |
} |
} |
100 |
# Build a multi-selection scrolling list big enough to show all the genome IDs. Note |
# Build a multi-selection scrolling list big enough to show all the genome IDs. Note |
101 |
# that we pre-select every element. |
# that we pre-select every element. |
102 |
$varHash{"${setID}GenomeIDs"} = $query->scrolling_list("${setID}Genomes", $valueList, |
$varHash->{"${setID}GenomeIDs"} = $query->scrolling_list("${setID}Genomes", $valueList, |
103 |
$valueList, $valueCount, 1); |
$valueList, $valueCount, 1); |
104 |
} |
} |
105 |
# Now we create the similarity block object. |
# Now we create the similarity block object. |
119 |
my @valueList = sort keys %{$valueHash}; |
my @valueList = sort keys %{$valueHash}; |
120 |
# Compute the number of blocks. |
# Compute the number of blocks. |
121 |
my $valueCount = @valueList; |
my $valueCount = @valueList; |
122 |
$varHash{"${setID}Count"} = $valueCount; |
$varHash->{"${setID}Count"} = $valueCount; |
123 |
# Constrain it to compute the list height. |
# Constrain it to compute the list height. |
124 |
if ($valueCount > 50) { |
if ($valueCount > 50) { |
125 |
$valueCount = 50; |
$valueCount = 50; |
152 |
} |
} |
153 |
# If this is the both-list, save the snip count. |
# If this is the both-list, save the snip count. |
154 |
if ($setID eq "both") { |
if ($setID eq "both") { |
155 |
$varHash{snipCount} = $snipCount; |
$varHash->{snipCount} = $snipCount; |
156 |
} |
} |
157 |
# Build a single-selection scrolling list for this set of blocks. |
# Build a single-selection scrolling list for this set of blocks. |
158 |
$varHash{"${setID}BlockIDs"} = |
$varHash->{"${setID}BlockIDs"} = |
159 |
$query->scrolling_list(-name => "${setID}Blocks", |
$query->scrolling_list(-name => "${setID}Blocks", |
160 |
-values => \@valueList, |
-values => \@valueList, |
161 |
-size => $valueCount, |
-size => $valueCount, |
181 |
"Html"); |
"Html"); |
182 |
} |
} |
183 |
# Put the alignment in the variable hash. |
# Put the alignment in the variable hash. |
184 |
$varHash{alignment} = $alignmentHTML; |
$varHash->{alignment} = $alignmentHTML; |
185 |
# Now we need to create the distance matrix. |
# Now we need to create the distance matrix. |
186 |
Trace("Computing distances.") if T(1); |
Trace("Computing distances.") if T(1); |
187 |
my %distanceMatrix = SimBlocks::DistanceMatrix(\%alignment); |
my %distanceMatrix = SimBlocks::DistanceMatrix(\%alignment); |
225 |
$distanceHTML .= $row; |
$distanceHTML .= $row; |
226 |
} |
} |
227 |
# Add it to the variable hash. |
# Add it to the variable hash. |
228 |
$varHash{distanceMatrix} = $distanceHTML; |
$varHash->{distanceMatrix} = $distanceHTML; |
229 |
Trace("Building web page.") if T(1); |
}; |
230 |
# Flush the trace messages. |
# Check for an error from the EVAL. |
231 |
$varHash{TraceMessages} = QTrace('html'); |
if ($@) { |
232 |
# Generate the web page. |
Trace("Script error: $@") if T(0); |
233 |
my $page = PageBuilder::Build("<Html/SimBlockDisplay.html", \%varHash, "Html"); |
} |
234 |
print $page; |
# Display the web page. |
235 |
|
ScriptFinish("Html/SimBlockDisplay.html", $varHash); |
236 |
|
|
237 |
1; |
1; |