Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mapseq DM for v6 #6607

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,21 @@ def download_untar_store(url, tmp_path, dest_path):
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)

Expand All @@ -69,8 +81,12 @@ def main():
# 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",
Expand All @@ -85,8 +101,6 @@ def main():
with open(args.output) as fh:
params = json.load(fh)

print(params)

workdir = params["output_data"][0]["extra_files_path"]
os.mkdir(workdir)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</command>
<inputs>
<!-- <param name="test_data_manager" type="hidden" /> -->
<param name="test_data_manager_v5" type="boolean" truevalue="--test" falsevalue="" checked="False" label="Download minimal test DB and create mock data table entry." />
<param name="test_data_manager_v6" type="boolean" truevalue="--test" falsevalue="" checked="False" label="Download minimal test DB and create mock data table entry." />
<param name="test_data_manager_v5" type="boolean" truevalue="--test" falsevalue="" checked="False" label="Download minimal test DB and create mock data table entry for v5." />
<param name="test_data_manager_v6" type="boolean" truevalue="--test" falsevalue="" checked="False" label="Download minimal test DB and create mock data table entry for v6." />

<param name="database_type" type="select" multiple="false" label="Database Type">
<option value="mgnify_v6_lsu">MGnify LSU (v6.0)</option>
Expand Down
Loading