Mercurial > repos > dereeper > plink
comparison find_indiv.py @ 0:fe39a4677281 draft
Uploaded
| author | dereeper |
|---|---|
| date | Fri, 05 Aug 2016 09:46:55 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:fe39a4677281 |
|---|---|
| 1 import sys | |
| 2 import os | |
| 3 import re | |
| 4 | |
| 5 def get_field_samples_options(dataset): | |
| 6 options = [] | |
| 7 line=os.popen("grep '#CHROM' %s"%dataset.file_name).read()[:-1].split('\t') | |
| 8 index=line.index('FORMAT') | |
| 9 for opt in line[index+1:] : | |
| 10 options.append((opt,opt, True)) | |
| 11 return options | |
| 12 | |
| 13 def get_field_chrs_options(dataset): | |
| 14 options = [] | |
| 15 chrs=os.popen("grep '##contig' %s"%dataset.file_name).read()[:-1].split('\n') | |
| 16 for line in chrs: | |
| 17 opt=re.search('^##contig=<ID=(\w+),length=',line).group(1) | |
| 18 options.append((opt,opt, True)) | |
| 19 return options | |
| 20 |
