Skip to content

Commit 06f3210

Browse files
committed
ONT basecall model extraction more resilient
1 parent 9374d11 commit 06f3210

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

wdl/tasks/Utility/ONTUtils.wdl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,16 @@ task GetBasecallModel {
344344
set -eux
345345
346346
export GCS_OAUTH_TOKEN=$(gcloud auth application-default print-access-token)
347+
export GCS_REQUESTER_PAYS_PROJECT=$(gcloud config get-value project)
347348
samtools view -H ~{bam} | grep "^@RG" > one_rg_per_line.txt
348349
349350
while IFS= read -r line
350351
do
351352
echo "$line" | tr '\t' '\n' | grep "^DS:" | sed "s/^DS://" | tr ' ' '\n' > tmp.txt
352-
runid=$(grep -E "^run(-)?id=" tmp.txt | awk -F '=' '{print $2}')
353-
model=$(grep "^basecall_model=" tmp.txt | awk -F '=' '{print $2}')
353+
runid=$(grep -E "^run(-)?id=" tmp.txt | awk -F '=' '{print $2}' || true)
354+
model=$(grep "^basecall_model=" tmp.txt | awk -F '=' '{print $2}' || true)
355+
runid=${runid:-null}
356+
model=${model:-null}
354357
echo -e "${runid}\t${model}" >> results.tsv
355358
done < one_rg_per_line.txt
356359
>>>

0 commit comments

Comments
 (0)