Skip to content
Snippets Groups Projects
Unverified Commit 2f796b63 authored by Cedrick Agaser's avatar Cedrick Agaser Committed by GitHub
Browse files

Merge pull request #243 from biowdl/bcftools_setid

Bcftools: added annotation and sorting
parents 6d39e056 4664f90c
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ that users understand how the changes affect the new version.
version 5.0.0-dev
---------------------------
+ bcftools: add sorting and annotation
+ Bam2fastx: Input bam and index are now arrays.
+ Lima: Remove globs from outputs.
+ Updated task gridss.wdl: add --jvmheap parameter
......
......@@ -22,6 +22,149 @@ version 1.0
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
task Annotate {
input {
File? annsFile
String? collapse
Array[String] columns = []
String? exclude
Boolean force = false
File? headerLines
String? newId
String? include
Boolean keepSites = false
String? markSites
Boolean noVersion = false
String outputType = "z"
String? regions
File? regionsFile
File? renameChrs
Array[String] samples = []
File? samplesFile
Boolean singleOverlaps = false
Array[String] removeAnns = []
File inputFile
String outputPath = "output.vcf.gz"
Int threads = 0
String memory = "256M"
Int timeMinutes = 1 + ceil(size(inputFile, "G"))
String dockerImage = "quay.io/biocontainers/bcftools:1.10.2--h4f4756c_2"
}
command {
set -e
mkdir -p "$(dirname ~{outputPath})"
bcftools annotate \
-o ~{outputPath} \
-O ~{outputType} \
~{"--annotations " + annsFile} \
~{"--collapse " + collapse} \
~{true="--columns" false="" length(columns) > 0} ~{sep="," columns} \
~{"--exclude " + exclude} \
~{true="--force" false="" force} \
~{"--header-lines " + headerLines} \
~{"--set-id " + newId} \
~{"--include " + include} \
~{true="--keep-sites" false="" keepSites} \
~{"--mark-sites " + markSites} \
~{true="--no-version" false="" noVersion} \
~{"--regions " + regions} \
~{"--regions-file " + regionsFile} \
~{"--rename-chrs " + renameChrs} \
~{true="--samples" false="" length(samples) > 0} ~{sep="," samples} \
~{"--samples-file " + samplesFile} \
~{true="--single-overlaps" false="" singleOverlaps} \
~{true="--remove" false="" length(removeAnns) > 0} ~{sep="," removeAnns} \
~{inputFile}
bcftools index --tbi ~{outputPath}
}
output {
File outputVcf = outputPath
File outputVcfIndex = outputPath + ".tbi"
}
runtime {
memory: memory
time_minutes: timeMinutes
docker: dockerImage
}
parameter_meta {
outputPath: {description: "The location the output VCF file should be written.", category: "common"}
outputType: {description: "Output type: v=vcf, z=vcf.gz, b=bcf, u=uncompressed bcf", category: "advanced"}
annsFile: {description: "Bgzip-compressed and tabix-indexed file with annotations (see man page for details).", category: "advanced"}
collapse: {description: "Treat as identical records with <snps|indels|both|all|some|none>, see man page for details.", category: "advanced"}
columns: {description: "Comma-separated list of columns or tags to carry over from the annotation file (see man page for details).", category: "advanced"}
exclude: {description: "Exclude sites for which the expression is true (see man page for details).", category: "advanced"}
force: {description: "Continue even when parsing errors, such as undefined tags, are encountered.", 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"}
include: {description: "Select sites for which the expression is true (see man page for details).", category: "advanced"}
keepSites: {description: "Keep sites which do not pass -i and -e expressions instead of discarding them.", category: "advanced"}
markSites: {description: "Annotate sites which are present ('+') or absent ('-') in the -a file with a new INFO/TAG flag.", category: "advanced"}
noVersion: {description: "Do not append version and command line information to the output VCF header.", category: "advanced"}
regions: {description: "Restrict to comma-separated list of regions.", category: "advanced"}
regionsFile: {description: "Restrict to regions listed in a file.", category: "advanced"}
renameChrs: {description: "rename chromosomes according to the map in file (see man page for details).", category: "advanced"}
samples: {description: "List of samples for sample stats, \"-\" to include all samples.", category: "advanced"}
samplesFile: {description: "File of samples to include.", category: "advanced"}
singleOverlaps: {description: "keep memory requirements low with very large annotation files.", category: "advanced"}
removeAnns: {description: "List of annotations to remove (see man page for details).", category: "advanced"}
inputFile: {description: "A vcf or bcf file.", category: "required"}
threads: {description: "Number of extra decompression threads [0].", 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"}
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"}
}
}
task Sort {
input {
File inputFile
String outputPath = "output.vcf.gz"
String memory = "256M"
Int timeMinutes = 1 + ceil(size(inputFile, "G"))
String dockerImage = "quay.io/biocontainers/bcftools:1.10.2--h4f4756c_2"
String outputType = "z"
}
command {
set -e
mkdir -p "$(dirname ~{outputPath})"
bcftools sort \
-o ~{outputPath} \
-O ~{outputType} \
~{inputFile}
bcftools index --tbi ~{outputPath}
}
output {
File outputVcf = outputPath
File outputVcfIndex = outputPath + ".tbi"
}
runtime {
memory: memory
time_minutes: timeMinutes
docker: dockerImage
}
parameter_meta {
inputFile: {description: "A vcf or bcf file.", category: "required"}
outputPath: {description: "The location the output VCF file should be written.", category: "common"}
outputType: {description: "Output type: v=vcf, z=vcf.gz, b=bcf, u=uncompressed bcf", 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"}
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"}
}
}
task View {
input {
File inputFile
......
......@@ -28,7 +28,7 @@ task CallSV {
File bamIndex
File referenceFasta
File referenceFastaFai
String outputPath = "./delly/delly.vcf"
String outputPath = "./delly/delly.bcf"
String memory = "15G"
Int timeMinutes = 300
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment