[2] | 1 | """
|
---|
| 2 | # after running the qc, need to rename various output files
|
---|
| 3 | <data format="html" name="html_file" />
|
---|
| 4 | <data format="txt" name="log_file" parent="html_file" />
|
---|
| 5 | <data format="tabular" name="marker_file" parent="html_file" />
|
---|
| 6 | <data format="tabular" name="subject_file" parent="html_file" />
|
---|
| 7 | <data format="tabular" name="freq_file" parent="html_file" />
|
---|
| 8 | </outputs>
|
---|
| 9 | """
|
---|
| 10 | from galaxy import datatypes,model
|
---|
| 11 | import sys,time
|
---|
| 12 |
|
---|
| 13 | def timenow():
|
---|
| 14 | """return current time as a string
|
---|
| 15 | """
|
---|
| 16 | return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time()))
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
|
---|
| 20 | """Change data file names
|
---|
| 21 |
|
---|
| 22 | """
|
---|
| 23 | job_name = param_dict.get( 'out_prefix', 'rgQCdefault' )
|
---|
| 24 | html = ['html','%s.html' % job_name]
|
---|
| 25 | lookup={}
|
---|
| 26 | lookup['html_file'] = html
|
---|
| 27 | info = '%s QC report by rgQC at %s' % (job_name,timenow())
|
---|
| 28 | for aname in lookup.keys():
|
---|
| 29 | data = out_data[aname]
|
---|
| 30 | data_type,newname = lookup[aname]
|
---|
| 31 | data = app.datatypes_registry.change_datatype(data, data_type)
|
---|
| 32 | data.name = newname
|
---|
| 33 | data.info = info
|
---|
| 34 | out_data[aname] = data
|
---|
| 35 | app.model.context.flush()
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 |
|
---|