-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wdl to extract chr:pos:ref:alt from an array of VCF files
- Loading branch information
1 parent
0f2eaa3
commit 4e75dd2
Showing
2 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
version 1.0 | ||
|
||
workflow extract_vcf_ids { | ||
input { | ||
Array[File] vcf_file | ||
} | ||
|
||
scatter (f in vcf_file) { | ||
call bcftools_query { | ||
input: vcf_file = f | ||
} | ||
} | ||
|
||
call concat_files { | ||
input: files = bcftools_query.variant_file | ||
} | ||
|
||
output { | ||
File variant_file = concat_files.output_file | ||
} | ||
|
||
meta { | ||
author: "Stephanie Gogarten" | ||
email: "[email protected]" | ||
} | ||
} | ||
|
||
|
||
task bcftools_query { | ||
input { | ||
File vcf_file | ||
} | ||
|
||
command <<< | ||
bcftools query -f '%CHROM:%POS:%REF:%ALT\n' ~{vcf_file} > variants.txt | ||
>>> | ||
|
||
output { | ||
File variant_file = "variants.txt" | ||
} | ||
|
||
runtime { | ||
docker: "staphb/bcftools:1.16" | ||
} | ||
} | ||
|
||
|
||
task concat_files { | ||
input { | ||
Array[File] files | ||
} | ||
|
||
command <<< | ||
cat ~{sep=' ' files} > concat.txt | ||
>>> | ||
|
||
output { | ||
File output_file = "concat.txt" | ||
} | ||
|
||
runtime { | ||
docker: "staphb/bcftools:1.16" | ||
} | ||
} |