changeset 6:a04cebcd77f4 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_hisat2_index_builder commit 02d2967f77e3fa5a18aea63dc84aa9ab418dc165"
author iuc
date Sun, 22 Nov 2020 12:49:53 +0000
parents 8eac26f44d29
children d74c740bdb25
files data_manager/hisat2_index_builder.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/hisat2_index_builder.py	Mon Nov 18 17:22:30 2019 -0500
+++ b/data_manager/hisat2_index_builder.py	Sun Nov 22 12:49:53 2020 +0000
@@ -3,11 +3,11 @@
 from __future__ import print_function
 
 import argparse
+import json
 import os
 import shlex
 import subprocess
 import sys
-from json import dumps, loads
 
 DEFAULT_DATA_TABLE_NAME = "hisat2_indexes"
 
@@ -66,7 +66,8 @@
 
     filename = options.output
 
-    params = loads(open(filename).read())
+    with open(filename) as fh:
+        params = json.load(fh)
     data_manager_dict = {}
 
     if options.fasta_dbkey in [None, '', '?']:
@@ -78,7 +79,8 @@
     build_hisat_index(data_manager_dict, options, params, sequence_id, sequence_name)
 
     # save info to json file
-    open(filename, 'w').write(dumps(data_manager_dict, sort_keys=True))
+    with open(filename, 'w') as fh:
+        json.dump(data_manager_dict, fh, sort_keys=True)
 
 
 if __name__ == "__main__":