Skip to content

Commit

Permalink
attempt to maybe fix the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesemery committed Feb 19, 2025
1 parent af592aa commit 0ba9cc8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions wdl/tasks/Z_One_Off_Analyses/BroadOnPremMalariaPipelineTasks.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,25 @@ task SortCompressIndexVcf {
tot_mem_mb=$(free -m | grep '^Mem' | awk '{print $2}')
################################
bcftools sort -m$((tot_mem_mb-2048))M -Oz2 -o ./$(basename ~{input_vcf}).gz ~{input_vcf}
bcftools index --threads ${np} --tbi ~$(basename ~{input_vcf}).gz
# Define output file names in the root execution directory
output_vcf="./$(basename ~{input_vcf}).gz"
output_index="${output_vcf}.tbi"
# Run bcftools sort and index, ensuring output is in the execution root
bcftools sort -m$((tot_mem_mb-2048))M -Oz -o "${output_vcf}" ~{input_vcf}
bcftools index --threads ${np} --tbi "${output_vcf}"
# Verify files exist
ls -lah "${output_vcf}" "${output_index}"
>>>
output {
File vcf = "$(basename ~{input_vcf}).gz"
File vcf_index = "$(basename ~{input_vcf}).gz.tbi"
File sorted_vcf = "$(basename input_vcf).gz"
File sorted_vcf_index = "$(basename input_vcf).gz.tbi"
}


#########################
RuntimeAttr default_attr = object {
cpu_cores: 2,
Expand Down

0 comments on commit 0ba9cc8

Please sign in to comment.