Mercurial > repos > dereeper > plink
comparison find_indiv.py @ 4:6d1122b57344 draft
Uploaded
author | dereeper |
---|---|
date | Thu, 02 Nov 2017 05:42:47 -0400 |
parents | fe39a4677281 |
children |
comparison
equal
deleted
inserted
replaced
3:2bc9b3ee5eea | 4:6d1122b57344 |
---|---|
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 |