-
Notifications
You must be signed in to change notification settings - Fork 0
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
TSPS-326 add wdl to mask or subset a vcf given a bed file #136
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
61 changes: 61 additions & 0 deletions
61
pipelines/imputation/scientificValidation/SubsetVcfByBedFile.wdl
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,61 @@ | ||
version 1.0 | ||
|
||
# This script is under review. It is not actively tested or maintained at this time. | ||
workflow SubsetVcfByBedFile { | ||
input { | ||
File input_vcf | ||
File input_vcf_index | ||
File bed_file | ||
} | ||
|
||
call BcftoolsSubsetVcf { | ||
input: | ||
input_vcf = input_vcf, | ||
input_vcf_index = input_vcf_index, | ||
bed_file = bed_file | ||
} | ||
|
||
output { | ||
File subset_vcf = BcftoolsSubsetVcf.output_vcf | ||
File subset_vcf_index = BcftoolsSubsetVcf.output_vcf_index | ||
} | ||
} | ||
|
||
task BcftoolsSubsetVcf { | ||
input { | ||
File input_vcf | ||
File input_vcf_index | ||
File bed_file | ||
|
||
Int disk_size_gb = ceil(3 * size(input_vcf, "GiB")) + 20 | ||
Int cpu = 1 | ||
Int memory_mb = 6000 | ||
} | ||
|
||
String basename = basename(input_vcf, '.vcf.gz') | ||
|
||
command { | ||
set -e -o pipefail | ||
|
||
bcftools view \ | ||
-R ~{bed_file} \ | ||
-O z \ | ||
-o ~{basename}.subset.vcf.gz \ | ||
~{input_vcf} | ||
|
||
bcftools index -t ~{basename}.subset.vcf.gz | ||
|
||
} | ||
|
||
output { | ||
File output_vcf = "~{basename}.subset.vcf.gz" | ||
File output_vcf_index = "~{basename}.subset.vcf.gz.tbi" | ||
} | ||
|
||
runtime { | ||
docker: "us.gcr.io/broad-gatk/gatk:4.5.0.0" | ||
disks: "local-disk ${disk_size_gb} HDD" | ||
memory: "${memory_mb} MiB" | ||
cpu: cpu | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.