Mercurial > repos > xuebing > sharplabtool
comparison tools/rgenetics/rgLDIndep_code.py @ 0:9071e359b9a3
Uploaded
author | xuebing |
---|---|
date | Fri, 09 Mar 2012 19:37:19 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9071e359b9a3 |
---|---|
1 from galaxy import app | |
2 import os, string, time | |
3 | |
4 def timenow(): | |
5 """return current time as a string | |
6 """ | |
7 return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time())) | |
8 | |
9 | |
10 | |
11 def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): | |
12 name,data = out_data.items()[0] | |
13 basename = param_dict['title1'] | |
14 killme = string.punctuation + string.whitespace | |
15 trantab = string.maketrans(killme,'_'*len(killme)) | |
16 title = basename.encode().translate(trantab) | |
17 info = '%s filtered by rgLDIndep.py at %s' % (title,timenow()) | |
18 data.file_name = data.file_name | |
19 data.metadata.base_name = title | |
20 data.name = '%s.pbed' % title | |
21 data.info = info | |
22 app.model.context.flush() | |
23 | |
24 | |
25 |