Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

use localized copy of vep custom inputs #47

Merged
merged 1 commit into from
Aug 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions definitions/tools/vep.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ task vepTask {
Array[String] plugins
Boolean coding_only = false
Array[String] custom_args
# Require files are necessary to force a localization. The call itself uses them
# via the custom_args field, which is a string and won't localize its parts.
# Required files are necessary to force localization. The call itself uses them
# via the custom_args field, which is a string and won't localize its parts, but
# does need to be pointed to the right inputs dir after localization
Array[File] required_files # !UnusedDeclaration
Boolean everything = true
# one of [pick, flag_pick, pick-allele, per_gene, pick_allele_gene, flag_pick_allele, flag_pick_allele_gene]
Expand All @@ -42,6 +43,9 @@ task vepTask {

command <<<
mkdir ~{cache_dir} && unzip -qq ~{cache_dir_zip} -d ~{cache_dir}
#custom vep inputs (required files) get localized and we have to define this variable
#pointing to their current path so that the custom string works as expected
custom_inputs_dir=$(dirname ~{required_files[0]})

/usr/bin/perl -I /opt/lib/perl/VEP/Plugins /usr/bin/variant_effect_predictor.pl \
--format vcf \
Expand Down Expand Up @@ -84,14 +88,13 @@ task parseVepCustomAnnotationIntoArg {
python <<CODE
check_existing = "~{true="--check_existing" false="" obj.annotation.check_existing}"
custom = ",".join([
"~{obj.annotation.file}",
"$" + "custom_inputs_dir/~{basename(obj.annotation.file)}",
"~{obj.annotation.name}",
"~{obj.annotation.data_format}",
"~{obj.method}",
"~{true=1 false=0 obj.force_report_coordinates}",
"~{sep="," obj.annotation.vcf_fields}"
])

print(f"{check_existing} --custom {custom}")
CODE
>>>
Expand Down