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