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

HISAT2.wdl: replace output command substitutions with explicit fifo/wait #233

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 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
20 changes: 16 additions & 4 deletions library/tasks/HISAT2.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ task HISAT2PairedEnd {
# --seed to fix pseudo-random number and in order to produce deterministics results
# --secondary reports secondary alignments for multimapping reads. -k 10
# searches for up to 10 primary alignments for each read
mkfifo samtools_pipe
samtools view -1 -h -o "${output_basename}_unsorted.bam" samtools_pipe & pid=$!
hisat2 -t \
-x ${ref_name}/${ref_name} \
-1 $FQ1 \
Expand All @@ -73,7 +75,8 @@ task HISAT2PairedEnd {
--seed 12345 \
-k 10 \
--secondary \
-p ${cpu} -S >(samtools view -1 -h -o ${output_basename}_unsorted.bam)
-p ${cpu} -S samtools_pipe
wait $pid
samtools sort -@ ${cpu} -O bam -o "${output_basename}.bam" "${output_basename}_unsorted.bam"
samtools index "${output_basename}.bam"
}
Expand Down Expand Up @@ -158,6 +161,8 @@ task HISAT2RSEM {
# with no-splice-alignment no-softclip no-mixed options on, HISAT2 will only output concordant alignment without soft-cliping
# --rdg 99999999,99999999 and --rfg 99999999,99999999 will set an infinite penalty to alignments with indels.
# As a result, alignments with gaps or deletions are excluded.
mkfifo samtools_pipe
samtools view -1 -h -o "${output_basename}.bam" samtools_pipe & pid=$!
hisat2 -t \
-x ${ref_name}/${ref_name} \
-1 $FQ1 \
Expand All @@ -178,7 +183,8 @@ task HISAT2RSEM {
--rfg 99999999,99999999 \
--no-spliced-alignment \
--seed 12345 \
-p ${cpu} -S >(samtools view -1 -h -o ${output_basename}.bam)
-p ${cpu} -S samtools_pipe
wait $pid
}

runtime {
Expand Down Expand Up @@ -236,6 +242,8 @@ task HISAT2SingleEnd {
tar --no-same-owner -xvf "${hisat2_ref}"

# The parameters for this task are copied from the HISAT2PairedEnd task.
mkfifo samtools_pipe
samtools view -1 -h -o "${output_basename}_unsorted.bam" samtools_pipe & pid=$!
hisat2 -t \
-x ${ref_name}/${ref_name} \
-U ${fastq} \
Expand All @@ -246,7 +254,8 @@ task HISAT2SingleEnd {
--seed 12345 \
-k 10 \
--secondary \
-p ${cpu} -S >(samtools view -1 -h -o ${output_basename}_unsorted.bam)
-p ${cpu} -S samtools_pipe
wait $pid
samtools sort -@ ${cpu} -O bam -o "${output_basename}.bam" "${output_basename}_unsorted.bam"
samtools index "${output_basename}.bam"
}
Expand Down Expand Up @@ -367,6 +376,8 @@ task HISAT2RSEMSingleEnd {
# with no-splice-alignment no-softclip no-mixed options on, HISAT2 will only output concordant alignment without soft-cliping
# --rdg 99999999,99999999 and --rfg 99999999,99999999 will set an infinite penalty to alignments with indels.
# As a result, alignments with gaps or deletions are excluded.
mkfifo samtools_pipe
samtools view -1 -h -o "${output_basename}.bam" samtools_pipe & pid=$!
hisat2 -t \
-x ${ref_name}/${ref_name} \
-U $FQ \
Expand All @@ -386,7 +397,8 @@ task HISAT2RSEMSingleEnd {
--rfg 99999999,99999999 \
--no-spliced-alignment \
--seed 12345 \
-p ${cpu} -S >(samtools view -1 -h -o ${output_basename}.bam)
-p ${cpu} -S samtools_pipe
wait $pid
}

runtime {
Expand Down