index.html 12.8 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
       <span class="uid">{{=request.vars['id']}}</span> {{=info["name"]}}
11
12
13
14
15
16
17
18
    </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>
24
                    {{ for class_name in sorted(classification.keys()): }}
25
26
27
28
29
30
31
                      {{ class_elt = classification[class_name] }}
                      <optgroup label="{{ =class_elt['name'] }}"  title="{{ =class_elt['info'] }}">
                        {{ for row in class_elt['configs']: }}
                            <option value="{{=row.id }}" {{if row.id==config_id:}}selected{{pass}} title="{{=row.info}}" >
                                {{=row.name}}
                            </option>
                        {{pass}}
32
                      </optgroup>
33
34
35
36
37
38
39
40
41
                    {{pass}}
                </select>
            </span>
        {{pass}}</div>
        
    </div>

</div>

42

43
44
45
46
47
48
49
50
51
52
    
    
    
<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>
53
                <td> pre-process </td>
54
55
56
57
58
59
60
61
62
63
64
		{{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>
65
66
                <td class="column5"></td>
                <td class="column5"></td>
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

            </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}}">
82
                       {{if row.sequence_file.network:}}<i class="icon-upload-cloud-outline" title="This file is stored on your lab's network"></i>{{pass}}
83
		       {{if auth.is_admin():}}({{=row.sequence_file.id}}){{pass}}
84
85
86
                         {{=row.sequence_file.filename}}
                    </td>
                    <td> {{if row.sequence_file.sampling_date <> None:}} {{=row.sequence_file.sampling_date}} {{pass}}</td>
87
                    <td> {{=tag_decorator.sanitize(tag_decorator.decorate(row.sequence_file.info, 'tag', 'sequence_file', '/sample_set/custom'))}} </td>
88
89
                    <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>
90
91
                    {{ has_pre_process = row.sequence_file.pre_process_id != None}}
                    <td {{if has_pre_process:}} class="pointer"
92
                        title="View more information on the pre-process {{=pre_process_list[row.sequence_file.pre_process_id]}}"{{pass}}
93
                        {{if has_pre_process:}} onclick="db.call('pre_process/info', {'sequence_file_id' :'{{=row.sequence_file.id }}', 'sample_set_id' : '{{=request.vars["id"]}}'} )" {{pass}}
94
                        >
95
96
97
                        {{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}} 
98
                        {{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}}
99
                        {{ if has_pre_process and row.sequence_file.pre_process_flag is None and row.sequence_file.data_file2 is None: }}<span title="All the files have not been properly received yet. It this persists, please edit the sample to reupload them.">[waiting file]</span>{{pass}}
100
                        {{if row.sequence_file.pre_process_id != None :}} {{=pre_process_list[row.sequence_file.pre_process_id]}} {{pass}}
101
                     </td>
102
103
104
105
106
		    {{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:}}
Ryan Herbert's avatar
Ryan Herbert committed
107
                        <td class="pointer" onclick="db.call('file/form', {'file_id' :'{{=row.sequence_file.id}}', 'sample_type': '{{=sample_type}}'} )" >  <i class="icon-pencil-2" title="edit sample information"></i> </td>
108
109
110
                    {{else:}}
                      <td></td>
                    {{pass}}
111
                        <td> <a {{if row.sequence_file.data_file == None :}} {{=XML("class='inactive' title='file is missing' ")}}
112
                                {{else:}} href="{{=URL('patient','download', scheme='https', args=row.sequence_file.data_file)}}" {{pass}}  ><i class="icon-down" title="Download sequence file"></i></a></td>
113
                    {{if can_modify:}}
114
                        <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>
115
                    {{else:}}<td></td>{{pass}}
116
117
118
119
120
121
122
123
124
125
126
127
128


                    <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)))}}
129
                               type="application/octet-stream"><i class="icon-down" title="Download result file"></i></a>
130
131
                        {{pass}}
                     </td>
132
                     <td {{if status in ["COMPLETED", "FAILED"]:}} class="pointer" onclick="db.call('results_file/output', { 'results_file_id' : '{{=row.results_file.id}}' }) " {{else:}} class="inactive" {{pass}}><i class="icon-docs" title="See the output files"></i></td>
133
                    {{if can_modify and auth.can_process_sample_set(request.vars['id']):}}
134
                     <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>
135
136
137
138
                    {{else:}}
                     <td></td>
                    {{pass}}
                   {{else:}}
139
                     <td></td><td></td><td></td><td></td>
140
141
                   {{pass}}
                   <td>
flothoni's avatar
flothoni committed
142
                   {{if row.sequence_file.data_file != None and ( row.results_file.id == None and ( status not in ["RUNNING", "QUEUED", "ASSIGNED"]) ) and (not has_pre_process or row.sequence_file.pre_process_flag != None) :}}
143
                       {{if auth.can_process_sample_set(request.vars['id']) and (config_id > 0 and auth.can_use_config(config_id)) :}}
144
                           <span class="pointer" onclick="db.call('default/run_request', { 'sequence_file_id' : '{{=row.sequence_file.id}}', 'sample_set_id' : {{=request.vars["id"]}}, 'config_id' : {{=config_id}} } )"><i class="icon-cog-2" title="Run the selected configuration for this file"></i></span>
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
                       {{pass}}
                   {{pass}}
                   </td>
                </tr>
            {{pass}}

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

    
    
    
    
    
   <br /><br />
161
   {{if can_modify:}}
162
   <i class="icon-pencil-2 pointer" title="edit information" onclick="db.call('sample_set/form', { 'id' : '{{=request.vars["id"]}}' } )" > </i>
163
   {{pass}}
164
165
   {{ text = tag_decorator.decorate(info["info"], 'tag', sample_type, '/sample_set/all') }}
   {{=tag_decorator.sanitize(text)}}
166
167

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

        {{pass}}


176
   {{if auth.can_process_sample_set(request.vars['id']) :}}
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
  <!--
   <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: }}
194
        <span class="button2" onclick="db.call('file/form', { 'sample_set_id' : '{{=request.vars["id"]}}' } )"> + add samples </span>
195
196

        {{pass}}
197
        <span class="button2" onclick="db.call('sample_set/custom', {'id': '{{=request.vars['id']}}', 'filter': ''} )">compare some of these samples</span>
198
199
200
201
    </div>


    <div class="db_block_right">
202
        see results:
203
        {{for row in db( (db.fused_file.sample_set_id == request.vars["id"]) & 
HERBERT Ryan's avatar
HERBERT Ryan committed
204
                         (auth.vidjil_accessible_query(PermissionEnum.read_config.value, db.config) | auth.vidjil_accessible_query(PermissionEnum.admin_config.value, db.config) ) &
205
206
207
208
                         (db.config.id ==db.fused_file.config_id)
                       ).select() :}}
        
            {{if row.fused_file.fused_file is not None :}}
209
                <a class="button2" href="index.html?sample_set_id={{=request.vars["id"]}}&config={{=row.config.id}}" type="text/html"
210
211
                      onclick="event.preventDefault()
                               if( event.which == 2 ) { window.open(this.href) }
212
                               else { myUrl.loadUrl(db, { 'sample_set_id' : '{{=request.vars["id"]}}' , 'config' : {{=row.config.id}} }, '{{=info["filename"]}}' ) }" >
213
214
215
            {{pass}}
                {{=row.config.name}} </a>
        {{pass}}
216
        {{ if fused_count > 0: }}
Ryan Herbert's avatar
Ryan Herbert committed
217
        <a id="stats_button" target="_blank" class="button2 devel-mode" href="/vidjil/sample_set/result_files?sample_set_ids={{=request.vars['id']}}&config_id=-1">export all results</a>
218
        {{ pass }}
219
220
221
222
223
224
225
226
227
    </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}}
228
            <a class="button" href={{=URL('default', 'get_data', scheme='https', vars=dict(sample_set_id = request.vars['id'], config = request.vars['config_id'], filename=vidjil_utils.safe_encoding(fused_filename)))}}> .vidjil </a>
229
            {{if analysis_count >0:}}
230
            <a class="button" href={{=URL('default', 'get_analysis', scheme='https', vars=dict(sample_set_id = request.vars['id'], config = request.vars['config_id'], filename=vidjil_utils.safe_encoding(analysis_filename)))}}> .analysis </a>
231
232
233
234
235
236
237
            {{pass}}
        {{pass}}
    </div>
</div>
{{pass}}

</div>