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

feat: add expected output checking to test_wrapper.py run() function (fix: ensembl-reference wrapper download >1 chromosome) #3432

Merged
Merged
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8d30eea
fix: get ensembl-reference wrapper to download more than one chromosome
dlaehnemann Nov 6, 2024
dfdd743
different debugging output
dlaehnemann Nov 6, 2024
8fae1dd
fix: avoid `break` for chromosome specs
dlaehnemann Nov 6, 2024
249d5e4
remove debugging output
dlaehnemann Nov 6, 2024
23b8788
reset success status for every try of a chromosome
dlaehnemann Nov 6, 2024
19536bc
fix chromosome download failure logic and error message
dlaehnemann Nov 8, 2024
5545e40
Merge branch 'master' into fix/ensembl-reference-with-multiple-chromo…
johanneskoester Nov 21, 2024
038a716
chore: add expected file for two chromosomes download test
dlaehnemann Jan 28, 2025
198f3ae
chore: adapt Snakefile to match expected file
dlaehnemann Jan 28, 2025
088b1ec
feat: adapt tests and use filecmp, albeit still in the wrong place...
dlaehnemann Jan 28, 2025
dc57e10
Merge branch 'fix/ensembl-reference-with-multiple-chromosomes' of git…
dlaehnemann Jan 28, 2025
baf7b82
feat: add expected output comparison to testing, use it in one wrapper
dlaehnemann Jan 29, 2025
94650d3
Merge branch 'master' into fix/ensembl-reference-with-multiple-chromo…
dlaehnemann Jan 29, 2025
d0a5beb
chore: remove unused return value
dlaehnemann Jan 29, 2025
2d3db38
docs: add documentation of expected output checking
dlaehnemann Jan 29, 2025
b077de9
chore: use snakemake.logging.logger.error where appropriate
dlaehnemann Jan 30, 2025
d56d0b9
chore: rename new output comparison argument for testing `run()` func…
dlaehnemann Jan 31, 2025
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
7 changes: 4 additions & 3 deletions bio/reference/ensembl-sequence/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
if chromosome:
if not datatype == "dna":
raise ValueError(
"invalid datatype, to select a single chromosome the datatype must be dna"
"Invalid datatype. To select individual chromosomes, the datatype must be dna."
)

url = snakemake.params.get("url", "ftp://ftp.ensembl.org/pub")
spec = spec.format(build=build, release=release)
url_prefix = f"{url}/{branch}release-{release}/fasta/{species}/{datatype}/{species.capitalize()}.{spec}"

success = False
for suffix in suffixes:
success = False
dlaehnemann marked this conversation as resolved.
Show resolved Hide resolved
dlaehnemann marked this conversation as resolved.
Show resolved Hide resolved
url = f"{url_prefix}.{suffix}"

try:
Expand All @@ -65,7 +65,8 @@

shell("(curl -L {url} | gzip -d >> {snakemake.output[0]}) {log}")
success = True
break
if not chromosome:
break

if not success:
if len(suffixes) > 1:
Expand Down
Loading