index.html 11.1 KB
Newer Older
1
2
3
4
5
6
7
{{extend 'db_layout.html'}}
{{import vidjil_utils}}


<div>

    <h3>
8
9
    <i class="icon-left-open-1" title="previous" onclick="db.call('sample_set/index', {'next': '1', 'id' :'{{=request.vars['id']}}', 'config_id' : '{{=request.vars['config_id']}}'})"></i>
    <i class="icon-right-open-1" title="next" onclick="db.call('sample_set/index', {'next': '-1', 'id' :'{{=request.vars['id']}}', 'config_id' : '{{=request.vars['config_id']}}'})"></i>
10
11
12
13
14
15
16
17
18
        {{=info["name"]}}
    </h3>

        
        
    <div class="db_block">

        <div class="db_block_left"> {{=info["label"]}} </div>
        
19
        <div class="db_block_right"> {{if auth.can_process_sample_set(request.vars['id']) :}}
20
21
            config
            <span>
22
                <select id="choose_config" name="config" onchange="db.call('sample_set/index', {'id' :'{{=request.vars['id']}}', 'config_id' : this.value})">
23
                    <option value="-1" {{if not config :}}selected{{pass}}> --- </option>
HERBERT Ryan's avatar
HERBERT Ryan committed
24
                    {{for row in db((auth.vidjil_accessible_query(PermissionEnum.read.value, db.config) | auth.vidjil_accessible_query(PermissionEnum.admin.value, db.config) ) ).select(orderby=~db.config.name) :}}
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
                        <option value="{{=row.id }}" {{if row.id==config_id:}}selected{{pass}} title="{{=row.info}}" >
                            {{=row.name}}
                        </option>
                    {{pass}}
                </select>
            </span>
        {{pass}}</div>
        
    </div>

</div>

    
    
    
    
    
    
    
<div id="db_table_container">
    <table class="db_table" id="table">
        <thead>
            <tr><td class="column_200"> file name </td>
                <td class="column_100"> sampling date </td>
                <td> info </td>
                <td> size </td>
51
                <td> pre-process </td>
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
		{{if auth.is_admin():}} <td> uploader </td> {{pass}}
                <td class="column5"> </td>
                <td class="column5"> </td>
                <td class="column5"> </td>

                <td class="column_sep"></td>

                <td class="column2">last processing</td>
                <td class="column_100">status</td>
                <td class="column5"></td>
                <td class="column5"></td>
                <td class="column4"></td>

            </tr>
        </thead>
        
        
        <tbody>
            {{for row in query :}}
                {{if row.results_file.scheduler_task_id is None or db.scheduler_task[row.results_file.scheduler_task_id ] is None:}}
                    {{status = '' }}
                {{else:}}
                    {{status = db.scheduler_task[row.results_file.scheduler_task_id ].status }}
                {{pass}}

                 <tr>
                    <td {{if row.sequence_file.data_file == None :}} {{=XML("class='inactive' title='file is missing' ")}}  {{pass}} id="sequence_file_{{=row.sequence_file.id}}">
79
		       {{if auth.is_admin():}}({{=row.sequence_file.id}}){{pass}}
80
81
82
83
84
85
                         {{=row.sequence_file.filename}}
                    </td>
                    <td> {{if row.sequence_file.sampling_date <> None:}} {{=row.sequence_file.sampling_date}} {{pass}}</td>
                    <td> {{=row.sequence_file.info}} </td>
                    <td {{if row.sequence_file.data_file == None :}} {{=XML("class='inactive' title='file is missing' ")}} {{pass}} >
                        {{=vidjil_utils.format_size(row.sequence_file.size_file)}} </td>
86
87
                    {{ has_pre_process = row.sequence_file.pre_process_id != None}}
                    <td {{if has_pre_process:}} class="pointer"
88
                        title="View more information on the pre-process {{=pre_process_list[row.sequence_file.pre_process_id]}}"{{pass}}
89
                        {{if has_pre_process:}} onclick="db.call('pre_process/info', {'sequence_file_id' :'{{=row.sequence_file.id }}', 'sample_set_id' : '{{=request.vars["id"]}}'} )" {{pass}}
90
                        >
91
92
93
                        {{if row.sequence_file.pre_process_flag == "RUN" :}}<i class="icon-spin4" style="animation: spin 2s 1000 linear;
    display: inline-block;" title="running pre_processs"></i>{{pass}} 
                        {{if row.sequence_file.pre_process_flag == "WAIT" :}}[queued]{{pass}} 
94
                        {{if row.sequence_file.pre_process_flag == "FAILED" :}}[failed] <span class="button" onclick="db.call('file/restart_pre_process', {sequence_file_id: {{=row.sequence_file.id}}})">try again</span>{{pass}}
95
                        {{if row.sequence_file.pre_process_id != None :}} {{=pre_process_list[row.sequence_file.pre_process_id]}} {{pass}}
96
                     </td>
97
98
99
100
101
		    {{if auth.is_admin():}}
		    <td> {{=row.sequence_file.provider}} {{if row.sequence_file.provider:}}{{=row.sequence_file.provider.last_name}}{{pass}}</td>
		    {{pass}}

                    {{if can_modify:}}
102
                        <td class="pointer" onclick="db.call('file/edit', {'id' :'{{=row.sequence_file.id}}', 'sample_type': '{{=sample_type}}'} )" >  <i class="icon-pencil-2" title="edit sample information"></i> </td>
103
104
105
                    {{else:}}
                      <td></td>
                    {{pass}}
106
107
                        <td> <a {{if row.sequence_file.data_file == None :}} {{=XML("class='inactive' title='file is missing' ")}}
                                {{else:}} href="{{=URL('patient','download', scheme='https', args=row.sequence_file.data_file)}}" {{pass}}  >dl</a></td>
108
                    {{if can_modify:}}
109
                        <td class="pointer" onclick="db.call('file/confirm', {'id' :'{{=row.sequence_file.id }}', 'redirect_sample_set_id' : '{{=request.vars["id"]}}'} )" >  <i class="icon-erase" title="delete sample"></i> </td>
110
                    {{else:}}<td></td>{{pass}}
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126


                    <td class="column_sep"></td>


                   {{if row.results_file.run_date :}}
                       <td class="button" onclick="db.call('results_file/info', { 'results_file_id' : '{{=row.results_file.id}}' } )"> {{=row.results_file.run_date }}</td>
                   {{else:}}<td></td>{{pass}}
                   {{if row.results_file.id:}}
                     <td class="button" onclick="db.call('results_file/info', { 'results_file_id' : '{{=row.results_file.id}}' } )"> {{=status}} </td>
                     <td>
                        {{if row.results_file.data_file:}}
                            <a href={{=URL('default', 'download', scheme='https', args=row.results_file.data_file, vars=dict(filename='result-%s-%s.txt' % (request.vars['id'], row.results_file.id)))}}
                               type="application/octet-stream">dl</a>
                        {{pass}}
                     </td>
127
                    {{if can_modify and auth.can_process_sample_set(request.vars['id']):}}
128
                     <td class="pointer" onclick="db.call('results_file/confirm', {'results_file_id' :'{{=row.results_file.id}}', 'sample_set_id': '{{=request.vars["id"]}}'})" >  <i class="icon-erase" title="delete process"></i> </td>
129
130
131
132
133
134
135
136
                    {{else:}}
                     <td></td>
                    {{pass}}
                   {{else:}}
                     <td></td><td></td><td></td>
                   {{pass}}
                   <td>
                   {{if row.sequence_file.data_file != None and ( row.results_file.id == None or ( status != "RUNNING" and status != "QUEUED" and status != "ASSIGNED") ):}}
137
                       {{if auth.can_process_sample_set(request.vars['id']) and (config_id > 0 and auth.can_use_config(config_id)) :}}
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
                           <span class="button" onclick="db.call('default/run_request', { 'sequence_file_id' : '{{=row.sequence_file.id}}', 'sample_set_id' : {{=request.vars["id"]}}, 'config_id' : {{=config_id}} } )"> run >> </span>
    sample_set_id = fake_sample_set_id
                       {{pass}}
                   {{pass}}
                   </td>
                </tr>
            {{pass}}

        </tbody>
    </table>
    <table class="db_table" id="db_fixed_header"></table>

    
    
    
    
    
   <br /><br />
156
   {{if can_modify:}}
157
   <i class="icon-pencil-2" title="edit patient information" onclick="db.call('sample_set/edit', { 'id' : '{{=request.vars["id"]}}' } )" > </i>
158
   {{pass}}
159
160
161
   {{=info["info"]}}

        {{if can_upload: }}
162
        {{if not auth.can_process_sample_set(request.vars['id']) :}}
163
  <br /> Once your data are uploaded, please
164
  <a href="mailto:support@vidjil.org?Subject=%5Bvidjil%5D%20New%20sequences&Body=%0AHi%2C%0A%0AI%20uploaded%20some%20sequences%20on%20the%20app.vidjil.org%20server.%0ACould%20you%20run%20Vidjil%20on%20these%20data%20%3F%0A%0A">request an analysis</a>.
165
166
167
168
169
        {{pass}}

        {{pass}}


170
   {{if auth.can_process_sample_set(request.vars['id']) :}}
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
  <!--
   <div class="db_block_right">
     <b>News (2015-May-08)</b>
     <br/>Vidjil has been upgraded, and some configs have been renamed.
     <br/>The default TRG, IGH, multi+inc configs now use a e-value threshold that should give better results.
     <br/>We advise to not use the '[old]' configs for your new sequences.
   </div>
   -->
   {{pass}}

</div>


<div class="db_block">

    <div class="db_block_left">
        {{if can_upload: }}
188
        <span class="button2" onclick="db.call('file/add', { 'id' : '{{=request.vars["id"]}}' } )"> + add sample </span>
189
190

        {{pass}}
191
        <span class="button2" onclick="db.call('sample_set/custom', {'id': '{{=request.vars['id']}}', 'filter': ''} )">compare samples for this patient</span>
192
193
194
195
196
197
    </div>


    <div class="db_block_right">
        see the result:
        {{for row in db( (db.fused_file.sample_set_id == request.vars["id"]) & 
HERBERT Ryan's avatar
HERBERT Ryan committed
198
                         (auth.vidjil_accessible_query(PermissionEnum.read_config.value, db.config) | auth.vidjil_accessible_query(PermissionEnum.admin_config.value, db.config) ) &
199
200
201
202
                         (db.config.id ==db.fused_file.config_id)
                       ).select() :}}
        
            {{if row.fused_file.fused_file is not None :}}
203
                <a class="button2" href="index.html?sample_set_id={{=request.vars["id"]}}&config={{=row.config.id}}" type="text/html"
204
205
                      onclick="event.preventDefault()
                               if( event.which == 2 ) { window.open(this.href) }
206
                               else { db.load_data( { 'sample_set_id' : '{{=request.vars["id"]}}' , 'config' : {{=row.config.id}} }, '{{=info["filename"]}}' ) }" >
207
208
209
210
211
212
213
214
215
216
217
218
            {{pass}}
                {{=row.config.name}} </a>
        {{pass}}
    </div>

</div>

{{if fused_count >0:}}
<div class="db_block">
    <div class="db_block_right">
        {{if fused_file is not None :}}
            download {{=db.config[config_id].name}}
219
            <a class="button" href={{=URL('default', 'get_data', scheme='https', vars=dict(sample_set_id = request.vars['id'], config = request.vars['config_id'], filename=fused_filename))}}> .vidjil </a>
220
            {{if analysis_count >0:}}
221
            <a class="button" href={{=URL('default', 'get_analysis', scheme='https', vars=dict(sample_set_id = request.vars['id'], config = request.vars['config_id'], filename=analysis_filename))}}> .analysis </a>
222
223
224
225
226
227
228
            {{pass}}
        {{pass}}
    </div>
</div>
{{pass}}

</div>