-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathautomate_bed_callable.py
executable file
·33 lines (23 loc) · 1.15 KB
/
automate_bed_callable.py
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
32
33
#!/usr/bin/env python
from __future__ import print_function
import argparse
from qsub import q_sub
def main():
# argument parser
parser = argparse.ArgumentParser()
parser.add_argument('-call_fa', help='Callable fasta file', required=True)
parser.add_argument('-chr_list', help='File of chromosomes to calc callable sites for', required=True)
parser.add_argument('-region_list', help='text file with pairs of labels and bed files', required=True)
parser.add_argument('-out_pre', help='output path and prefix', required=True)
parser.add_argument('-evolgen', help='If specified will submit to lab queue', default=False, action='store_true')
args = parser.parse_args()
for region in open(args.region_list):
tag, bed = region.split()
out_stem = args.out_pre + '_' + tag
cmd = ('~/parus_indel/summary_analyses/callable_sites_bed.py '
'-call_fa {} -chr_list {} '
'-bed {} -tag {} '
'> {}').format(args.call_fa, args.chr_list, bed, tag, out_stem + '.txt')
q_sub([cmd], out=out_stem, mem=10, rmem=10, evolgen=args.evolgen)
if __name__ == '__main__':
main()