annotate tools/rgenetics/rgLDIndep_code.py @ 1:cdcb0ce84a1b

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:45:15 -0500
parents 9071e359b9a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 from galaxy import app
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 import os, string, time
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 def timenow():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 """return current time as a string
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 """
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time()))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 name,data = out_data.items()[0]
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 basename = param_dict['title1']
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 killme = string.punctuation + string.whitespace
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 trantab = string.maketrans(killme,'_'*len(killme))
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 title = basename.encode().translate(trantab)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 info = '%s filtered by rgLDIndep.py at %s' % (title,timenow())
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 data.file_name = data.file_name
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 data.metadata.base_name = title
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 data.name = '%s.pbed' % title
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 data.info = info
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 app.model.context.flush()
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25