-
Notifications
You must be signed in to change notification settings - Fork 0
/
hiv-reporter
executable file
·35 lines (28 loc) · 1.58 KB
/
hiv-reporter
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
34
35
#!/usr/bin/env python3
from report_writer import hiv_short_report as report
from report_writer import hiv_mutation as mutation
from report_writer import hiv_sequence as sequence
from report_writer import utils
import argparse
import json
import os
def main(args):
with open(args.sierrapy_json) as f:
data = json.load(f)
sierrapy_json = data[0]
utils.create_output_directory(args.output_dir)
output_path = utils.create_output_prefix(args.output_dir, args.output_prefix)
report.write_report_tables(output_path, args.sample_id, sierrapy_json)
sequence.write_sequences_to_file(output_path, args.sample_id, sierrapy_json)
#mutation.extract_drug_resistance_mutations(sierrapy_json)
#mutation.extract_all_mutations(sierrapy_json)
#write_mutations_csv(output_path, args.sample_id, sierrapy_json)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description = 'Turns SierraPy JSON into useful output')
required_args = parser.add_argument_group('required arguments')
required_args.add_argument('-j', '--json', action='store', required=True, dest='sierrapy_json', help='JSON file from SierraPy program')
required_args.add_argument('-i', '--id', action='store', required=True, dest='sample_id', help='Sample ID')
required_args.add_argument('-p', '--prefix', action='store', required=True, dest='output_prefix', help='Output file prefix')
parser.add_argument('-o', '--output_directory', default=os.getcwd(), action='store', dest='output_dir', help='Output directory [Default: $(pwd)]')
args = parser.parse_args()
main(args)