Skip to content

Commit

Permalink
logic handling valid biosample or SRA
Browse files Browse the repository at this point in the history
  • Loading branch information
fraser-combe committed Nov 22, 2024
1 parent f00cdd0 commit f9de101
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tasks/utilities/data_handling/task_fetch_srr_accession.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ task fetch_srr_accession {
volatile: true
}

command <<<
command <<<
set -euo pipefail

# Output the current date and fastq-dl version for debugging
Expand Down Expand Up @@ -40,8 +40,14 @@ task fetch_srr_accession {
echo "No SRR accession found" > srr_accession.txt
fi
else
echo "SRR workflow failed for ~{sample_accession}, invalid biosample ID or SRA"
exit 1
# Handle cases where fastq-dl exits with an error
if grep -q "No results found" stderr || [[ ! -f fastq-run-info.tsv ]]; then
echo "No SRR accession found for valid biosample ID or SRA: ~{sample_accession}"
echo "No SRR accession found" > srr_accession.txt
else
echo "fastq-dl failed for ~{sample_accession}, invalid biosample ID or SRA"
exit 1
fi
fi
>>>
output {
Expand Down

0 comments on commit f9de101

Please sign in to comment.