changeset 2:316961434166 draft

Uploaded
author estrain
date Mon, 23 May 2022 09:35:13 +0000
parents 6dfbca41a8c4
children 2c887282d3ef
files data_manager_amrfinderplus/data_manager/data_manager_amrfinderplus.py
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager_amrfinderplus/data_manager/data_manager_amrfinderplus.py	Mon May 23 09:10:19 2022 +0000
+++ b/data_manager_amrfinderplus/data_manager/data_manager_amrfinderplus.py	Mon May 23 09:35:13 2022 +0000
@@ -82,14 +82,22 @@
     parser.add_argument('--out', type=str, required=True, nargs=1, help='output file')
 
     args = parser.parse_args()
-  
-    os.mkdir("amrdb")
-    os.chdir("amrdb") 
+
+
+    with open(args.out[0]) as fh:
+        config = json.load(fh)
+
+    output_directory = config.get("output_data", [{}])[0].get("extra_files_path", None)
+    data_manager_dict = {}
+    data_manager_dict["data_tables"] = config.get("data_tables", {})
+    data_manager_dict["data_tables"][args.datatable_name] = data_manager_dict[
+        "data_tables"
+    ].get(args.datatable_name, [])
+
     #Fetch the files and build blast databases
     version=download_from_ncbi()    
-    os.chdir("..")
 
     #shutil.copytree("amrdb",args.path[0])
-    print_json(version,os.path.abspath("amrdb"),args.name[0],args.out[0])
+    print_json(version,output_directory,args.name[0],args.out[0])
 
 if __name__ == "__main__": main()