6
2
<%python scope="init">
7
from asterias.lib.util.constants import *
9
newDir = tmpDir.split("/")[-1]
11
f = open(tmpDir + "COVARIABLES/covariable_summary")
3
from asterias.lib.util.constants import POMELO2_TMPDIR, INPUT_CGI_OPTION
5
tmpDir = POMELO2_TMPDIR + g.newDir
7
f = open(tmpDir + "/COVARIABLES/covariable_summary")
12
8
summary_lines = f.read()
15
f = open(tmpDir + "class_labels");
16
subj = f.read().split();
19
f = open(tmpDir + "COVARIABLES/names_covariables")
20
names_covar = f.read().split()
23
max_df = str(len(subj)-2)
24
name_list = '\",\"'.join(names_covar)
25
name_list = '\"' + name_list + '\"'
27
# Create list of zeros
30
zeros_list.append("0")
31
value_list = ','.join(zeros_list)
11
names_covar = g.name_list
34
14
<& header.myt, title='- Covariables' &>
36
<% h.form(h.url(action='check_covariables'), method='post', enctype='multipart/form-data', name="covariable_form") %>
38
<div id = "results_title" class="Title_box">
39
Check and choose covariables
42
<INPUT TYPE="hidden" NAME=<% INPUT_CGI_OPTION %> VALUE = "covar_launch">
43
<INPUT TYPE="hidden" NAME=<% INPUT_TMPDIR %> VALUE = <% tmpDir %>>
45
<div id = "results" class="results_box" >
16
<FORM action="check_covariables" method="POST" name="covariable_form">
18
<div id = "results_title" class="Title_box">
19
Check and choose covariables
22
<INPUT TYPE="hidden" NAME=<% INPUT_CGI_OPTION %> VALUE = "covar_launch">
24
<div id = "results" class="results_box" >
49
28
<table style="position:relative; left:4%">
52
<img SRC="/images/question_mark_cut.png" border=0 class="question" onClick="open_help('./help/pomelo2/check_covariables.html')">
55
<B>Check covariables are read properly and choose which to use:</B>
30
<td><img SRC="/images/question_mark_cut.png" border=0 class="question" OnClick="open_help('./help/pomelo2/check_covariables.html')"></td>
31
<td><B>Check covariables are read properly and choose which to use:</B></td>
81
56
<span style="position:relative; left:5%">
82
57
<INPUT TYPE="checkbox" NAME=<% covar_name %> VALUE=<% covar_name %>
83
onClick="box_changed('" + <% covar_name %> + "', " + <% df %> + ")" >
58
onClick="<% h.remote_function(update="chosen_covar_table",
59
url=h.url_for('change_covariables_table',controller='pomelo2',covar_name=covar_name,df=df)) %>" >
85
61
<span style="position:relative; left:8%; font-weight:bold; font-size:large"> <% covar_name %> </span>
86
62
<span style="position:relative; left:10%; color:ff6600; font-weight:bold;">(NON-NUMERIC COVARIABLE)</span>
94
70
% factor_names = summary_values[j].split()
95
71
% factor_frequency = summary_values[j+1].split()
96
72
% for i_name, i_freq in zip(factor_names, factor_frequency):
97
% <tr><td> <% i_name %> </td><td> <% i_freq %> </td></tr>
73
<tr><td><% i_name %></td><td><% i_freq %></td></tr>
114
91
% summary_values = text_line[3].split()
116
93
<span style="position:relative; left:5%">
117
<INPUT TYPE="checkbox" NAME=<% covar_name %> VALUE=<% covar_name %>
118
onClick="box_changed('" + <% covar_name %> + "',1)" >
94
<INPUT TYPE="checkbox" NAME=<% covar_name %> VALUE=<% covar_name %>
95
onClick="<% h.remote_function(update="chosen_covar_table",
96
url=h.url_for('change_covariables_table',controller='pomelo2',covar_name=covar_name,df=1)) %>" >
120
98
<span style="position:relative; left:8%; font-weight:bold; font-size:large"> <% covar_name %> </span>
121
99
<span style="position:relative; left:10%; color:ff6600; font-weight:bold;"> (NUMERIC COVARIABLE) </span>
125
103
<td style="width:15%" valign="top">
127
<tr><td>Minimum Value:</td><td> </td><td> <% summary_values[0] %> </td></tr>
128
<tr><td>Maximum Value:</td><td> </td><td> <% summary_values[5] %> </td></tr>
129
<tr><td>Mean Value:</td><td> </td><td align="right"> <% summary_values[3] %> </td></tr>
130
<tr><td>25% bellow(1st Quartile):</td><td> </td><td> <% summary_values[1] %> </td></tr>
131
<tr><td>50% bellow(median):</td><td> </td><td> <% summary_values[2] %> </td></tr>
132
<tr><td>75% bellow(3rd Quartile):</td><td> </td><td> <% summary_values[4] %> </td> </tr>
105
<tr><td>Minimum Value:</td><td> </td><td><% summary_values[0] %></td></tr>
106
<tr><td>Maximum Value:</td><td> </td><td><% summary_values[5] %></td></tr>
107
<tr><td>Mean Value:</td><td> </td><td align="right"><% summary_values[3] %></td></tr>
108
<tr><td>25% bellow(1st Quartile):</td><td> </td><td><% summary_values[1] %></td></tr>
109
<tr><td>50% bellow(median):</td><td> </td><td><% summary_values[2] %></td></tr>
110
<tr><td>75% bellow(3rd Quartile):</td><td> </td><td><% summary_values[4] %></td> </tr>
137
115
<td style="width:30%">
138
<img border=1 src='http://pomelo2.bioinfo.cnio.es/tmp/" + <% newDir %> + "/COVARIABLES/" + covar_name.strip() +".png'>
116
% src_img = "tmp/" + g.newDir + "/COVARIABLES/" + covar_name.strip() + ".png"
117
<img border=1 src=<% src_img %>>
146
% line_start = line_finish
125
% line_start = line_finish
152
130
<div id = "launch_covar" class="Title_box">
155
<div id = "results" class="results_box" >
157
<table style="position:relative; left:4%">
133
<div id = "results" class="results_box" >
137
<table style="position:relative; left:4%">
160
<img SRC="/images/question_mark_cut.png" border=0 class="question" onClick="open_help('./help/pomelo2/df_table.html')">
168
<div id = "chosen_covar_table">
169
No covariables selected.
172
<INPUT TYPE = "submit" name = "submit_button" VALUE = " Send selected covariables " disabled = true>
140
<img SRC="http://pomelo2.bioinfo.cnio.es/question_mark_cut.png" border=0 class="question"
141
onClick="open_help('df_table.html')">
143
<td><B>df table:</B></td>
148
<div id = "chosen_covar_table">
149
<& covariables_table.myt &>
154
<INPUT TYPE = "submit" name = "submit_button" VALUE = " Send selected covariables " disabled = true>
180
161
<& footer.myt, last_review='Apr 27th, 2006' &>
182
<%def covariables_table>
188
<%python scope="global">
192
if name_list[i]==name:
196
if value_list[position]==0:
197
value_list[position] = value
199
value_list[position] = 0
203
<table style="position:relative; left:4%">
205
<td><B>Covariable name</B></td>
206
<td> </td>
207
<td><B>Degrees of freedom used</B></td>
211
% for i in value_list:
212
% if value_list[i]!=0:
213
% total_df = total_df + value_list[i]
215
<td> <% name_list[i] %> </td>
216
<td> </td>
217
<td> <% value_list[i] %> </td>
223
<td colspan=3>___________________________</td>
226
<td><B>Total used</B></td>
227
<td> </td>
228
<td><B> <% total_df %> </B></td>
231
<td><B>Maximum allowed</td>
232
<td> </B></td>
233
<td><B> <% max_df %> </B></td>
237
% if max_df<total_df:
238
The number of total degrees of freedom ( <% total_df %> ) is greater than the limit ( <% max_df %> ).
240
To continue you must remove at least one covariable.
241
h.javascript_tag("document.covariable_form.submit_button.disabled = true")
243
No covariables selected.
244
h.javascript_tag("document.covariable_form.submit_button.disabled = true")
246
document.covariable_form.submit_button.disabled = false
247
h.javascript_tag("document.covariable_form.submit_button.disabled = false")