Skip to content
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
2 changes: 2 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def test_mixed_srr_and_fastq_same_sample_dry_run(request):
output = result.stdout + result.stderr
assert "unsupported mixed input_type values" not in output
assert "download_sra" in output
assert "while IFS= read -r url; do" in output
assert 'curl -fSL "$url"' in output
assert "merge_library_bams" in output
assert "library=libA" in output
assert "input_unit=u1" in output
Expand Down
2 changes: 1 addition & 1 deletion workflow/envs/sra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ channels:
- conda-forge
- bioconda
dependencies:
- sra-tools>=3.0
- sra-tools=3.2.1
- pigz>=2.6
- curl>=7.73
- ffq >=0.3.1
Expand Down
8 changes: 7 additions & 1 deletion workflow/rules/fastq.smk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ rule download_sra:
echo "Prefetch failed, trying ENA via ffq..." >> {log}
ffq --ftp {wildcards.accession} 2>> {log} \
| jq -r '.[].url' \
| xargs -I {{}} curl -fSL -o {params.outdir}/$(basename {{}}) {{}} 2>> {log}
| while IFS= read -r url; do
[[ -n "$url" ]] || continue
echo "Downloading: $url" >> {log}
curl -fSL "$url" \
-o {params.outdir}/$(basename "$url") \
>> {log} 2>&1
done
fi

[[ -f {output.r1} ]] && [[ -f {output.r2} ]]
Expand Down
Loading