Mercurial > repos > xuebing > sharplabtool
comparison tools/rgenetics/rgGLM_code.py @ 0:9071e359b9a3
Uploaded
| author | xuebing | 
|---|---|
| date | Fri, 09 Mar 2012 19:37:19 -0500 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| -1:000000000000 | 0:9071e359b9a3 | 
|---|---|
| 1 # before running the qc, need to rename various output files | |
| 2 import os,string,time | |
| 3 from galaxy import datatypes | |
| 4 | |
| 5 | |
| 6 def 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 | 
