1 | from galaxy import app |
---|
2 | import galaxy.util,string |
---|
3 | |
---|
4 | librepos = '/usr/local/galaxy/data/rg' |
---|
5 | myrepos = '/home/rerla/galaxy' |
---|
6 | marchinirepos = '/usr/local/galaxy/data/rg/snptest' |
---|
7 | |
---|
8 | #Provides Upload tool with access to list of available builds |
---|
9 | |
---|
10 | |
---|
11 | def get_rgRegionOutFormats(): |
---|
12 | """return options for formats""" |
---|
13 | dat = [['ucsc track','wig',False],['Strict genome graphs (rs+floats)','gg',True],['tab delimited','xls',False]] |
---|
14 | dat = [(x[0],x[1],x[2]) for x in dat] |
---|
15 | return dat |
---|
16 | |
---|
17 | |
---|
18 | def get_phecols(phef):
|
---|
19 | """return column names """
|
---|
20 | head = open(phef,'r').next()
|
---|
21 | c = head.strip().split()
|
---|
22 | res = [(cname,cname,False) for cname in c]
|
---|
23 | x,y,z = res[2] # 0,1 = fid,iid
|
---|
24 | res[2] = (x,y,True) # set second selected
|
---|
25 | return res |
---|
26 | |
---|
27 | |
---|
28 | def getAllcols(fname="/usr/local/galaxy/data/camp2007/camp2007.xls",outformat='gg'): |
---|
29 | """return column names other than chr offset as a select list""" |
---|
30 | head = open(fname,'r').next() |
---|
31 | c = head.strip().split() |
---|
32 | res = [(cname,'%d' % n,True) for n,cname in enumerate(c)] |
---|
33 | |
---|
34 | return res |
---|
35 | |
---|
36 | |
---|
37 | def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): |
---|
38 | """Sets the name of the data""" |
---|
39 | data_name = param_dict.get( 'tag', 'My region' ) |
---|
40 | outformat = param_dict.get( 'outformat', 'gg' ) |
---|
41 | outfile = param_dict.get( 'outfile1', 'lped' ) |
---|
42 | for name, data in out_data.items(): |
---|
43 | if name == 'tag': |
---|
44 | data = app.datatypes_registry.change_datatype(data, outformat) |
---|
45 | data.name = data_name |
---|
46 | out_data[name] = data |
---|
47 | |
---|