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

SRA_fetch workflow & fastq-dl task improvements #150

Merged
merged 6 commits into from
Aug 23, 2023
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
29 changes: 26 additions & 3 deletions tasks/utilities/task_sra_fetch.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,46 @@ version 1.0
task fastq_dl_sra {
input {
String sra_accession
String docker = "us-docker.pkg.dev/general-theiagen/biocontainers/fastq-dl:2.0.1--pyhdfd78af_0"
String docker = "us-docker.pkg.dev/general-theiagen/biocontainers/fastq-dl:2.0.4--pyhdfd78af_0"
Int disk_size = 100
Int cpus = 2
Int memory = 8
String? fastq_dl_opts
# default set to force the use of SRA instead of ENA due to SRA Lite FASTQ file format issues
String fastq_dl_opts = "--provider sra"
}
meta {
# so that call caching is always turned off
volatile: true
}
command <<<
# capture version
fastq-dl --version | tee VERSION
fastq-dl -a ~{sra_accession} ~{fastq_dl_opts}

# capture date in UTC timezone
date -u | tee DATE

# download fastq files
fastq-dl \
--verbose \
-a ~{sra_accession} \
--cpus ~{cpus} \
--prefix ~{sra_accession} \
~{fastq_dl_opts}

# tag single-end reads with _1
if [ -f "~{sra_accession}.fastq.gz" ] && [ ! -f "~{sra_accession}_1.fastq.gz" ]; then
mv "~{sra_accession}.fastq.gz" "~{sra_accession}_1.fastq.gz"
fi


>>>
output {
File read1 = "~{sra_accession}_1.fastq.gz"
File? read2 = "~{sra_accession}_2.fastq.gz"
File fastq_metadata = "~{sra_accession}-run-info.tsv"
String fastq_dl_version = read_string("VERSION")
String fastq_dl_docker = docker
String fastq_dl_date = read_string("DATE")
}
runtime {
docker: docker
Expand All @@ -30,5 +52,6 @@ task fastq_dl_sra {
disks: "local-disk " + disk_size + " SSD"
disk: disk_size + " GB" # TES
preemptible: 1
maxRetries: 3
}
}
4 changes: 4 additions & 0 deletions workflows/utilities/data_import/wf_sra_fetch.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ workflow fetch_sra_to_fastq {
output {
File read1 = fastq_dl_sra.read1
File? read2 = fastq_dl_sra.read2
File fastq_dl_fastq_metadata = fastq_dl_sra.fastq_metadata
String fastq_dl_version = fastq_dl_sra.fastq_dl_version
String fastq_dl_docker = fastq_dl_sra.fastq_dl_docker
String fastq_dl_date = fastq_dl_sra.fastq_dl_date
}
}