Skip to content

Commit

Permalink
🔧 added a working pipefail to tool
Browse files Browse the repository at this point in the history
  • Loading branch information
migbro committed May 10, 2024
1 parent b40609f commit 425dfa1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/bcftools_filter_vcf.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requirements:
ramMin: 1000
coresMin: 1
- class: InlineJavascriptRequirement
baseCommand: []
baseCommand: [bash -c 'set -eo pipefail &&]
arguments:
- position: 1
shellQuote: false
Expand All @@ -22,18 +22,18 @@ arguments:
}
var cmd = "bcftools view ";
if (inputs.include_expression != null){
cmd += "--include '" + inputs.include_expression + "' " + inputs.input_vcf.path;
cmd += "--include \"" + inputs.include_expression + "\" " + inputs.input_vcf.path;
if (inputs.exclude_expression != null){
cmd += " | bcftools view --exclude '" + inputs.exclude_expression + "' -O z > " + out_base + ".vcf.gz;";
cmd += " | bcftools view --exclude \"" + inputs.exclude_expression + "\"' -O z > " + out_base + ".vcf.gz;";
} else {
cmd += " -O z > " + out_base + ".vcf.gz;";
}
} else if (inputs.include_expression == null && inputs.exclude_expression != null){
cmd += "--exclude '" + inputs.exclude_expression + "' " + inputs.input_vcf.path + " -O z > " + out_base + ".vcf.gz;";
cmd += "--exclude \"" + inputs.exclude_expression + "\" " + inputs.input_vcf.path + " -O z > " + out_base + ".vcf.gz;";
} else if (inputs.include_expression == null && inputs.exclude_expression == null){
cmd = "cp " + inputs.input_vcf.path + " ./" + out_base + ".vcf.gz;";
}
cmd += "tabix " + out_base + ".vcf.gz;"
cmd += "tabix " + out_base + ".vcf.gz;'"
return cmd;
}
Expand Down

0 comments on commit 425dfa1

Please sign in to comment.