Skip to content

Commit

Permalink
updating demux
Browse files Browse the repository at this point in the history
  • Loading branch information
fraser-combe committed Nov 14, 2024
1 parent c94f59d commit e3df8f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tasks/basecalling/task_dorado_basecall.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ task basecall {
dorado --version > DORADO_VERSION 2>&1
echo "Captured Dorado version:" $(cat DORADO_VERSION)

# Define the model to use, substituting "sup" with the full model name if given
resolved_model="~{dorado_model}"
if [ "$resolved_model" = "sup" ]; then
resolved_model="[email protected]"
fi

# Log the resolved model name
echo "Using Dorado model: $resolved_model"
echo "$resolved_model" > "DORADO_MODEL"

# Define a log file path to capture output
log_file="dorado_basecall.log"

Expand Down Expand Up @@ -47,13 +57,6 @@ task basecall {
generated_sam=$(find "$sam_output" -name "*.sam" | head -n 1)
mv "$generated_sam" "$sam_file"

# Extract the detailed model name from the log file or set a default if extraction fails
model_name=$(grep -oP '(?<=downloading )[^ ]+' "$log_file" | head -n 1 || echo "unknown_model")

# Write the model name to DORADO_MODEL, or default to "unknown_model"
echo "Extracted Dorado model name: $model_name" | tee -a "$log_file"
echo "$model_name" > "DORADO_MODEL"

echo "Basecalling completed for ~{input_file}. SAM file renamed to: $sam_file" | tee -a "$log_file"
>>>

Expand Down
3 changes: 3 additions & 0 deletions tasks/basecalling/task_dorado_demux.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ task dorado_demux {
fastq_file_name="~{fastq_file_name}"
kit_name="~{kit_name}"

# Start the main log file for the entire task
exec > >(tee -a dorado_demux.log) 2>&1
echo "### Starting Dorado demux ###"
date

echo "Input BAM files:"
for bam_file in ~{sep=" " bam_files}; do echo "$bam_file"; done

Expand Down

0 comments on commit e3df8f6

Please sign in to comment.