Skip to content

Commit

Permalink
wdl to extract chr:pos:ref:alt from an array of VCF files
Browse files Browse the repository at this point in the history
  • Loading branch information
smgogarten committed Aug 3, 2024
1 parent 0f2eaa3 commit 4e75dd2
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ workflows:
primaryDescriptorPath: /bcftools_stats.wdl
testParameterFiles:
- /bcftools_stats.json
- name: check_vcf_samples
- name: extract_vcf_ids
subclass: WDL
primaryDescriptorPath: /check_vcf_samples.wdl
testParameterFiles:
- /check_vcf_samples.json
- name: test_data_tables
subclass: WDL
primaryDescriptorPath: /test_data_tables.wdl
testParameterFiles:
- /test_data_tables.json
primaryDescriptorPath: /extract_vcf_ids.wdl
64 changes: 64 additions & 0 deletions extract_vcf_ids.wdl
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"
}
}

0 comments on commit 4e75dd2

Please sign in to comment.