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

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

import galaxy-central

行番号 
1# before running the qc, need to rename various output files
2import os, string, time
3from galaxy import datatypes
4from galaxy import app
5import galaxy.util
6
7#Provides Upload tool with access to list of available builds
8repospath = '/usr/local/galaxy/data/rg'
9builds = []
10#Read build names and keys from galaxy.util
11for dbkey, build_name in galaxy.util.dbnames:
12    builds.append((build_name,dbkey,False))
13
14def timenow():
15    """return current time as a string
16    """
17    return time.strftime('%d/%m/%Y %H:%M:%S', time.localtime(time.time()))
18
19#Return available builds
20def get_available_builds(defval='hg18'):
21    for i,x in enumerate(builds):
22        if x[1] == defval:
23           x = list(x)
24           x[2] = True
25           builds[i] = tuple(x)
26    return builds
27
28# Create link to files here
29def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr):
30    base_name = param_dict.get( 'title1', 'Null_Phenotype' )
31    base_name = base_name.encode()
32    info = 'Null phenotypes created by rgfakePhe at %s' % timenow()
33    s = string.whitespace + string.punctuation
34    ptran =  string.maketrans(s,'_'*len(s))
35    base_name = base_name.translate(ptran)
36    data = out_data['ppheout']
37    data.name = '%s.phe' % (base_name) # that's how they've been named in rgfakePhe.py
38    data.file_name = data.file_name
39    data.metadata.base_name = base_name
40    out_data['pheout'] = data
41    app.model.context.flush()
42
43
44
45
46
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。