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

Ensure index files are stored under the same dir/bucket as their respective file in EH WDL #282

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Changes from all 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
13 changes: 12 additions & 1 deletion wdl/ExpansionHunter.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ task RunExpansionHunter {
command <<<
set -euxo pipefail

BAM_OR_CRAM_DIR="$(dirname "~{bam_or_cram}")"
BAM_OR_CRAM_INDEX_FILENAME="$(basename "~{bam_or_cram_index}")"
DEST="$BAM_OR_CRAM_DIR/$BAM_OR_CRAM_INDEX_FILENAME"
if [ $DEST != ~{bam_or_cram_index} ]; then
mv ~{bam_or_cram_index} $DEST
fi
Comment on lines +92 to +94
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the if?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my tests, mv exits with fail code if the file is already there.


REF="$(basename "~{reference_fasta}")"
mv ~{reference_fasta} $REF
mv ~{reference_fasta_index} $REF.fai

sex=""
if ~{defined(ped_file)}; then
sex=$(awk -F '\t' '{if ($2 == "~{sample_id}") {if ($5 == "1") {print "--sex male"; exit 0} else if ($5 == "2") {print "--sex female"; exit 0}}}' < ~{ped_file} )
Expand All @@ -97,7 +108,7 @@ task RunExpansionHunter {

ExpansionHunter \
--reads ~{bam_or_cram} \
--reference ~{reference_fasta} \
--reference $REF \
--variant-catalog ~{variant_catalog} \
--output-prefix ~{sample_id} \
--cache-mates \
Expand Down