PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/rgenetics/rgGLM_code.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 23 lines | 20 code | 2 blank | 1 comment | 0 complexity | cb712e2f72adeb567e5ba0c8703b4fe0 MD5 | raw file
 1# before running the qc, need to rename various output files
 2import os,string,time
 3from galaxy import datatypes 
 4
 5
 6def get_phecols(phef='',selectOne=0):
 7   """return column names """
 8   phepath = phef.extra_files_path
 9   phename = phef.metadata.base_name
10   phe = os.path.join(phepath,'%s.pphe' % phename)
11   head = open(phe,'r').next()
12   c = head.strip().split()[2:] # first are fid,iid
13   res = [(cname,cname,False) for cname in c]
14   if len(res) >= 1:
15       if selectOne:
16          x,y,z = res[0] # 0,1 = fid,iid
17          res[0] = (x,y,True) # set second selected
18       else:
19          res.insert(0,('None','None',True))
20   else:
21      res = [('None','no phenotype columns found',False),]
22   return res
23