forked from mdrasmus/argweaver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubsmc
executable file
·31 lines (22 loc) · 866 Bytes
/
subsmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import optparse
import argweaver
o = optparse.OptionParser()
o.add_option("-s", "--smc", metavar="SMC_FILE", default="-")
o.add_option("-o", "--output", metavar="OUTPUT_FILE", default="-")
o.add_option("-r", "--region", metavar="START-END")
#o.add_option("-n", "--nseqs", metavar="NUMBER_OF_SEQS", type="int",
# help="use a random subsst of sequences")
#o.add_option("--both-haps", action="store_true",
# help="use both haplotypes for each individual")
#o.add_option("-i", "--ind", metavar="INDIVIDUALS")
conf, args = o.parse_args()
#=============================================================================
# read data
if conf.region:
region = map(int, conf.region.split("-"))
else:
region = None
smc = argweaver.iter_smc_file(conf.smc, region=region)
# write
argweaver.write_smc(conf.output, smc)