# HG changeset patch # User iuc # Date 1733243434 0 # Node ID a0d77af1d226e8c31a7b57a1f2b7327a8e858671 # Parent 23511530b8fdf59979d85b975ffa509a74604d4e planemo upload for repository https://github.com/galaxyproject/tools-iuc/ commit b6798b5213eca0d4b176ad3aeef81127dac6dcab diff -r 23511530b8fd -r a0d77af1d226 data_manager_fetch_mapseq_db.py --- a/data_manager_fetch_mapseq_db.py Mon Sep 30 10:08:03 2024 +0000 +++ b/data_manager_fetch_mapseq_db.py Tue Dec 03 16:30:34 2024 +0000 @@ -52,9 +52,21 @@ tar = tarfile.open(tarfile_path) tar.extractall(extract_path) + print(f"Content of folder: {extract_path}", os.listdir(extract_path)) + + # case for mapseq v6: all DB files are directly in the tar.gz file + # remove the VERSION.txt file since the tool can only handle on .txt file in the DB if len(list(os.listdir(extract_path))) > 1: - print("More then one folder in zipped file, aborting !") + print(f"Found multiple files in {extract_path}. Copy the content.") + print(f"Copy data to {dest_path}") + version_file_path = os.path.join(extract_path, "VERSION.txt") + os.remove(version_file_path) + shutil.copytree(extract_path, dest_path) + print("Done !") + + # case for mapseq v5: all files are in a subfolder in the tar.gz file else: + print(f"Found a folder in {extract_path}. Copy the content of the folder.") for folder in os.listdir(extract_path): folder_path = os.path.join(extract_path, folder) @@ -69,8 +81,12 @@ # Parse Command Line parser = argparse.ArgumentParser(description="Create data manager JSON.") parser.add_argument("--out", dest="output", action="store", help="JSON filename") - parser.add_argument("--version", dest="version", action="store", help="Version of the DB") - parser.add_argument("--database-type", dest="db_type", action="store", help="Db type") + parser.add_argument( + "--version", dest="version", action="store", help="Version of the DB" + ) + parser.add_argument( + "--database-type", dest="db_type", action="store", help="Db type" + ) parser.add_argument( "--test", action="store_true", @@ -85,8 +101,6 @@ with open(args.output) as fh: params = json.load(fh) - print(params) - workdir = params["output_data"][0]["extra_files_path"] os.mkdir(workdir) diff -r 23511530b8fd -r a0d77af1d226 mapseq_db_fetcher.xml --- a/mapseq_db_fetcher.xml Mon Sep 30 10:08:03 2024 +0000 +++ b/mapseq_db_fetcher.xml Tue Dec 03 16:30:34 2024 +0000 @@ -17,8 +17,8 @@ - - + +