root/galaxy-central/tools/rgenetics/rgClean_code.py

リビジョン 2, 0.8 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1from galaxy import app
2import os, string, time
3
4def 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
11def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
12    name,data = out_data.items()[0]
13    basename = param_dict['title']
14    basename = basename.encode()
15    killme = string.punctuation + string.whitespace
16    trantab = string.maketrans(killme,'_'*len(killme))
17    title = basename.translate(trantab)
18    info = '%s filtered by rgClean.py at %s' % (title,timenow())
19    data.change_datatype('pbed')
20    data.file_name = data.file_name
21    data.metadata.base_name = title
22    data.name = '%s.pbed' % title
23    data.info = info
24    data.readonly = True
25    app.model.context.flush()
26
27
28
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。