Skip to content

Commit

Permalink
Merge pull request #150 from theiagen/cjk-sra-fetch-defaults
Browse files Browse the repository at this point in the history
SRA_fetch workflow & `fastq-dl` task improvements
  • Loading branch information
kevinlibuit authored Aug 23, 2023
2 parents 3dfe9ec + 1abb781 commit 4ee9b6d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
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
}
}

0 comments on commit 4ee9b6d

Please sign in to comment.