-
Notifications
You must be signed in to change notification settings - Fork 29
Add a task for SnpSift filter and update snpEff #340
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1ee07a6
add -no-upstream to snpeff task
DavyCats d9d989e
Add snpsift filter
DavyCats d4eb18d
add region input to bcftools view
DavyCats ecd2242
add an ipnut for an index file in bcftools view
DavyCats abcddcd
fix wdlTools parsing issue in bcftools annotate
DavyCats 748fe36
change name of snpsift task
DavyCats 2fc90c9
add a useless ls to check if a dnanexus error is caused by lazy loading
DavyCats 82a5715
add ls to snpeff, bcftools view and snpsift so I can see the paths wh…
DavyCats eafceb0
WIP add option to output compressed VCF files to snpeff and snpsift
DavyCats 16656ff
update changelog, fix missing variable
DavyCats 69a9c0a
Add a task for bcftools norm
DavyCats 5d4f5a7
more time for bcftools norm
DavyCats c97c55a
more time for bcftools Norm
DavyCats 88ac252
reset time for bcftools norm
DavyCats 3c8ec63
fix bcftools norm
DavyCats 5dab6c7
more memory for bcftools norm
DavyCats 99c562c
more memory for bcftools norm
DavyCats c676fe2
address review comments
DavyCats 89aa627
Merge branch 'develop' into snpeff_snpsift
DavyCats 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -111,7 +111,7 @@ task Annotate { | |
| collapse: {description: "Treat as identical records with <snps|indels|both|all|some|none>, see man page for details.", category: "advanced"} | ||
| exclude: {description: "Exclude sites for which the expression is true (see man page for details).", category: "advanced"} | ||
| headerLines: {description: "Lines to append to the VCF header (see man page for details).", category: "advanced"} | ||
| newId: {description: "Assign ID on the fly (e.g. --set-id +'%CHROM\_%POS').", category: "advanced"} | ||
| newId: {description: "Assign ID on the fly (e.g. --set-id +'%CHROM\\_%POS').", category: "advanced"} | ||
| include: {description: "Select sites for which the expression is true (see man page for details).", category: "advanced"} | ||
| markSites: {description: "Annotate sites which are present ('+') or absent ('-') in the -a file with a new INFO/TAG flag.", category: "advanced"} | ||
| regions: {description: "Restrict to comma-separated list of regions.", category: "advanced"} | ||
|
|
@@ -180,6 +180,71 @@ task Filter { | |
| } | ||
| } | ||
|
|
||
| task Norm { | ||
| input { | ||
| File inputFile | ||
| File? inputFileIndex | ||
| String outputPath = "output.vcf.gz" | ||
|
|
||
| File? fasta | ||
| String? regions | ||
| Boolean splitMultiallelicSites = false | ||
|
|
||
| String memory = "4GiB" | ||
| Int timeMinutes = 1 + ceil(size(inputFile, "G")) | ||
| Int diskGb = ceil(2.1 * size(inputFile, "G") + size(fasta, "G")) | ||
| String dockerImage = "quay.io/biocontainers/bcftools:1.10.2--h4f4756c_2" | ||
| } | ||
|
|
||
| Boolean compressed = basename(outputPath) != basename(outputPath, ".gz") | ||
|
|
||
| command { | ||
| set -e | ||
| ls ~{inputFile} ~{inputFileIndex} # dxCompiler localization workaroud | ||
|
|
||
| mkdir -p "$(dirname ~{outputPath})" | ||
| bcftools norm \ | ||
| -o ~{outputPath} \ | ||
| -O ~{true="z" false="v" compressed} \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an opportunity here to set it by default to z1:
That way it is always quite fast. |
||
| ~{"--regions " + regions} \ | ||
| ~{"--fasta " + fasta} \ | ||
| ~{if splitMultiallelicSites then "--multiallelics -both" else ""} \ | ||
| ~{inputFile} | ||
|
|
||
| ~{if compressed then "bcftools index --tbi ~{outputPath}" else ""} | ||
DavyCats marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| output { | ||
| File outputVcf = outputPath | ||
| File? outputVcfIndex = outputPath + ".tbi" | ||
| } | ||
|
|
||
| runtime { | ||
| memory: memory | ||
| time_minutes: timeMinutes | ||
| docker: dockerImage | ||
| disks: "local-disk ~{diskGb} SSD" # Based on an example in dxCompiler docs | ||
| } | ||
|
|
||
| parameter_meta { | ||
| # inputs | ||
| inputFile: {description: "A vcf or bcf file.", category: "required"} | ||
| outputPath: {description: "The location the output VCF file should be written.", category: "common"} | ||
| fasta: {description: "Equivalent to bcftools norm's `--fasta` option.", category: "advanced"} | ||
| regions: {description: "Equivalent to bcftools norm's `--regions` option.", category: "advanced"} | ||
| splitMultiallelicSites: {description: "Whether multiallelic lines should be split up.", category: "advanced"} | ||
|
|
||
| memory: {description: "The amount of memory this job will use.", category: "advanced"} | ||
| timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"} | ||
| diskGb: {description: "The amount of disk space needed for this job in GiB.", category: "advanced"} | ||
| dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", category: "advanced"} | ||
|
|
||
| # outputs | ||
| outputVcf: {description: "Normalized VCF file."} | ||
| outputVcfIndex: {description: "Index of Normalized VCF file."} | ||
| } | ||
| } | ||
|
|
||
| task Sort { | ||
| input { | ||
| File inputFile | ||
|
|
@@ -344,11 +409,13 @@ task Stats { | |
| task View { | ||
| input { | ||
| File inputFile | ||
| File? inputFileIndex | ||
| String outputPath = "output.vcf" | ||
| Boolean excludeUncalled = false | ||
|
|
||
| String? exclude | ||
| String? include | ||
| String? region | ||
| Array[String] samples = [] | ||
|
|
||
| String memory = "256MiB" | ||
|
|
@@ -360,6 +427,8 @@ task View { | |
|
|
||
| command { | ||
| set -e | ||
| ls ~{inputFile} ~{inputFileIndex} # dxCompiler localization workaroud | ||
|
|
||
| mkdir -p "$(dirname ~{outputPath})" | ||
| bcftools view \ | ||
| ~{"--exclude " + exclude} \ | ||
|
|
@@ -368,7 +437,8 @@ task View { | |
| ~{if length(samples) > 0 then "-s" else ""} ~{sep="," samples} \ | ||
| -o ~{outputPath} \ | ||
| -O ~{true="z" false="v" compressed} \ | ||
| ~{inputFile} | ||
| ~{inputFile} \ | ||
| ~{region} | ||
|
|
||
| ~{if compressed then 'bcftools index --tbi ~{outputPath}' else ''} | ||
| } | ||
|
|
@@ -387,9 +457,11 @@ task View { | |
| parameter_meta { | ||
| # inputs | ||
| inputFile: {description: "A vcf or bcf file.", category: "required"} | ||
| inputFileIndex: {description: "the index for the input file.", category: "common"} | ||
| outputPath: {description: "The location the output VCF file should be written.", category: "common"} | ||
| include: {description: "Select sites for which the expression is true (see man page for details).", category: "advanced"} | ||
| exclude: {description: "Exclude sites for which the expression is true (see man page for details).", category: "advanced"} | ||
| region: {description: "The region to retrieve from the VCF file.", category: "common"} | ||
| excludeUncalled: {description: "Exclude sites without a called genotype (see man page for details).", category: "advanced"} | ||
| samples: {description: "A list of sample names to include.", category: "advanced"} | ||
| memory: {description: "The amount of memory this job will use.", category: "advanced"} | ||
|
|
||
This file contains hidden or 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 hidden or 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,84 @@ | ||
| version 1.0 | ||
|
|
||
| # MIT License | ||
| # | ||
| # Copyright (c) 2025 Leiden University Medical Center | ||
| # | ||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the "Software"), to deal | ||
| # in the Software without restriction, including without limitation the rights | ||
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| # copies of the Software, and to permit persons to whom the Software is | ||
| # furnished to do so, subject to the following conditions: | ||
| # | ||
| # The above copyright notice and this permission notice shall be included in | ||
| # all copies or substantial portions of the Software. | ||
| # | ||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| # SOFTWARE. | ||
|
|
||
| task SnpSiftFilter { | ||
| input { | ||
| File vcf | ||
| File? vcfIndex | ||
| String filterExpression | ||
| String outputPath = "./snpsift_filter.vcf" | ||
|
|
||
| String memory = "9GiB" | ||
| String javaXmx = "8G" | ||
| Int timeMinutes = 60 | ||
| # Multicontainer with SnpSift 5.2 and bgzip/tabix 1.22 | ||
| String dockerImage = "quay.io/biocontainers/mulled-v2-d4bc0c23eb1d95c7ecff7f0e8b3a4255503fd5d4:c51b2e46bf63786b2d9a7a7d23680791163ab39a-0" | ||
| } | ||
|
|
||
| Boolean compressed = basename(outputPath) != basename(outputPath, ".gz") | ||
|
|
||
| command { | ||
| set -e | ||
| ls ~{vcf} ~{vcfIndex} # dxCompiler localization workaroud | ||
|
|
||
| mkdir -p "$(dirname ~{outputPath})" | ||
| SnpSift -Xmx~{javaXmx} -XX:ParallelGCThreads=1 \ | ||
| filter \ | ||
| "~{filterExpression}" \ | ||
| ~{vcf} \ | ||
| ~{if compressed then "| bgzip " else ""} > ~{outputPath} | ||
|
|
||
| ~{if compressed then "tabix ~{outputPath}" else ""} | ||
| } | ||
|
|
||
| output { | ||
| File outputVcf = outputPath | ||
| File? outputVcfIndex = outputPath + ".tbi" | ||
| } | ||
|
|
||
| runtime { | ||
| docker: dockerImage | ||
| time_minutes: timeMinutes # !UnknownRuntimeKey | ||
| memory: memory | ||
| } | ||
|
|
||
| parameter_meta { | ||
| # inputs | ||
| vcf: {description: "A VCF file to filter.", category: "required"} | ||
| vcfIndex: {description: "The index for the VCF file.", category: "common"} | ||
| filterExpression: {description: "The SnpSift filtering expression.", category: "required"} | ||
| outputPath: {description: "The path to write the output to.", category: "common"} | ||
|
|
||
| memory: {description: "The amount of memory this job will use.", category: "advanced"} | ||
| javaXmx: {description: "The maximum memory available to the program. Should be lower than `memory` to accommodate JVM overhead.", | ||
| category: "advanced"} | ||
| timeMinutes: {description: "The maximum amount of time the job will run in minutes.", category: "advanced"} | ||
| dockerImage: {description: "The docker image used for this task. Changing this may result in errors which the developers may choose not to address.", | ||
| category: "advanced"} | ||
DavyCats marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # outputs | ||
| outputVcf: {description: "Filtered VCF file."} | ||
| outputVcfIndex: {description: "Index of filtered VCF file."} | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.