-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: further adaptation to Snakemake 8
- Loading branch information
1 parent
72d705c
commit bffcbfd
Showing
2 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
def get_zenodo_tag(entry): | ||
if "restricted-access-token-envvar" in entry: | ||
return f"zenodo_{entry['deposition']}" | ||
else: | ||
return "zenodo" | ||
|
||
|
||
# add path to callsets | ||
for key, callset in config["variant-calls"].items(): | ||
if "path" not in callset and "zenodo" in callset: | ||
filename = callset["zenodo"]["filename"] | ||
callset["path"] = f"resources/zenodo/variant-calls/{key}/{filename}" | ||
if "zenodo" in callset: | ||
if "path" not in callset: | ||
filename = callset["zenodo"]["filename"] | ||
callset["path"] = f"resources/zenodo/variant-calls/{key}/{filename}" | ||
tag = get_zenodo_tag(callset["zenodo"]) | ||
if tag != "zenodo": | ||
workflow.storage_registry.register_storage( | ||
provider="zenodo", | ||
tag=tag, | ||
restricted_access_token=os.environ[ | ||
callset["zenodo"]["restricted-access-token-envvar"] | ||
], | ||
) | ||
|
||
|
||
def get_zenodo_input(wildcards): | ||
entry = config[wildcards.section][wildcards.entry]["zenodo"] | ||
|
||
provider = "zenodo" | ||
if "restricted-access-token-envvar" in entry: | ||
tag = f"zenodo_{entry['deposition']}" | ||
storage.register_storage( | ||
provider="zenodo", | ||
tag=tag, | ||
restricted_access_token=os.environ[ | ||
entry["restricted-access-token-envvar"] | ||
], | ||
) | ||
provider = tag | ||
return getattr(storage, provider)( | ||
tag = get_zenodo_tag(entry) | ||
return getattr(storage, tag)( | ||
f"zenodo://record/{entry['deposition']}/{entry['filename']}" | ||
) |