diff qc.py @ 6:878f18249f76 draft

"planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/qc commit 21d348651ca466563cc507b9e3a3fbd6c2b0a016"
author sanbi-uwc
date Mon, 12 Apr 2021 12:28:41 +0000
parents 2aa014ad54bc
children 6bdec8c62aec
line wrap: on
line diff
--- a/qc.py	Wed Apr 07 22:07:00 2021 +0000
+++ b/qc.py	Mon Apr 12 12:28:41 2021 +0000
@@ -6,6 +6,7 @@
 import pandas as pd
 import matplotlib.pyplot as plt
 import shlex
+import json
 
 """
 This script can incorporate as many QC checks as required
@@ -156,7 +157,12 @@
         writer = csv.DictWriter(csvfile, fieldnames=header)
         writer.writeheader()
         writer.writerow(qc_line)
-
+    
+    # write a json file from the dict
+    json_file = args.outfile + '.json'
+    with open(args.outfile, 'w') as jsonfile:
+       json.dump(qc_line, json_file)
+    
     N_density = sliding_window_N_density(fasta)
     make_qc_plot(depth_pos, N_density, args.sample)