-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateAssemblyJSON.py
More file actions
executable file
·34 lines (31 loc) · 1.39 KB
/
CreateAssemblyJSON.py
File metadata and controls
executable file
·34 lines (31 loc) · 1.39 KB
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
import sys
import argparse
ap=argparse.ArgumentParser(description="Create a .json file for running an assembly.")
ap.add_argument("--assembler", help="Which assembler to use: wtdbg2, flye, canu, or falcon", required=True)
ap.add_argument("--readtype", help="Read type: pacbio, ccs, or ont", required=True)
ap.add_argument("--bams", help="Input bams", nargs="+", required=True)
ap.add_argument("--workingDir", help="Run the assembly in this directory", required=True)
ap.add_argument("--sample", help="Sample", required=True)
ap.add_argument("--vcf", help="Phasing vcf", required=True)
ap.add_argument("--ref", help="Ref", required=True)
args=ap.parse_args()
if args.readtype == "ccs" or args.readtype == "ont":
consensus = "racon"
else:
consensus = "arrow"
sys.stdout.write("""{{
"bam" : [{}],
"working_dir" : "{}",
"sample" : "{}",
"ref" : "{}",
"vcf" : "{}",
"grid_large" : "sbatch --time=24:00:00 --partition=cmb",
"grid_manycore" : "sbatch --time=48:00:00 --partition=cmb",
"grid_medium" : "sbatch --time=24:00:00 --partition=cmb",
"grid_small" : "sbatch --time=4:00:00 --partition=cmb",
"grid_blat" : "sbatch --time=24:00:00 --partition=cmb",
"read-type" : "{}",
"consensus" : "{}",
"assembler" : "{}"
}}""".format(", ".join(args.bams), args.workingDir, args.sample, args.ref, args.vcf, args.readtype, consensus, args.assembler))