From d42281a9ae6eacc907cab8106dd5cda11760271c Mon Sep 17 00:00:00 2001 From: Kai Waldrant Date: Mon, 5 Feb 2024 22:25:06 +0100 Subject: [PATCH] add script to call --- src/lofreq/call/config.vsh.yaml | 16 ++++----- src/lofreq/call/script.sh | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 src/lofreq/call/script.sh diff --git a/src/lofreq/call/config.vsh.yaml b/src/lofreq/call/config.vsh.yaml index 321681ab..d979c2b5 100644 --- a/src/lofreq/call/config.vsh.yaml +++ b/src/lofreq/call/config.vsh.yaml @@ -25,6 +25,13 @@ functionality: Input BAM file. required: true example: "normal.bam" + - name: --ref + alternatives: -f + type: file + description: | + Indexed reference fasta file (gzip supported) [null]. + required: true + example: "reference.fasta" - name: Outputs arguments: - name: --output @@ -37,13 +44,6 @@ functionality: example: "output.vcf" - name: Arguments arguments: - - name: --ref - alternatives: -f - type: file - description: | - Indexed reference fasta file (gzip supported) [null]. - required: false - example: "reference.fasta" - name: --region alternatives: -r type: string @@ -157,8 +157,6 @@ functionality: description: | Ignore variants in this vcf file for source quality computation. Multiple files can be given separated by commas. required: false - multiple: true - separator: "," example: "variants.vcf" - name: --def_nm_q alternatives: -T diff --git a/src/lofreq/call/script.sh b/src/lofreq/call/script.sh new file mode 100644 index 00000000..39592c52 --- /dev/null +++ b/src/lofreq/call/script.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +## VIASH START +## VIASH END + +# Unset all parameters that are set to "false" +[[ "$par_no_baq" == "false" ]] && unset par_no_baq +[[ "$par_no_idaq" == "false" ]] && unset par_no_idaq +[[ "$par_del_baq" == "false" ]] && unset par_del_baq +[[ "$par_no_ext_baq" == "false" ]] && unset par_no_ext_baq +[[ "$par_no_mq" == "false" ]] && unset par_no_mq +[[ "$par_call_indels" == "false" ]] && unset par_call_indels +[[ "$par_only_indels" == "false" ]] && unset par_only_indels +[[ "$par_src_qual" == "false" ]] && unset par_src_qual +[[ "$par_illumina_13" == "false" ]] && unset par_illumina_13 +[[ "$par_use_orphan" == "false" ]] && unset par_use_orphan +[[ "$_plp_summary_only" == "false" ]] && unset _plp_summary_only +[[ "$par_no_default_filter" == "false" ]] && unset par_no_default_filter +[[ "$par_force_overwrite" == "false" ]] && unset par_force_overwrite +[[ "$par_verbose" == "false" ]] && unset par_verbose +[[ "$par_debug" == "false" ]] && unset par_debug + +# Run lofreq call +lofreq call \ + -f "$par_ref" \ + -o "$par_output" \ + ${par_region:+-r "${par_region}"} \ + ${par_bed:+-l "${par_bed}"} \ + ${par_min_bq:+-q "${par_min_bq}"} \ + ${par_min_alt_bq:+-Q "${par_min_alt_bq}"} \ + ${par_def_alt_bq:+-R "${par_def_alt_bq}"} \ + ${par_min_jq:+-j "${par_min_jq}"} \ + ${par_alt_jq:+-K "${par_alt_jq}"} \ + ${par_no_baq:+-B} \ + ${par_no_idaq:+-A} \ + ${par_del_baq:+-D} \ + ${par_no_ext_baq:+-e} \ + ${par_min_mq:+-m "${par_min_mq}"} \ + ${par_max_mq:+-M "${par_max_mq}"} \ + ${par_no_mq:+-N} \ + ${par_call_indels:+--call-indels} \ + ${par_only_indels:+--only-indels} \ + ${par_src_qual:+-s} \ + ${par_ign_vcf:+-S "${par_ign_vcf}"} \ + ${par_def_nm_q:+-T "${par_def_nm_q}"} \ + ${par_sig:+-a "${par_sig}"} \ + ${par_bonf:+-b "${par_bonf}"} \ + ${par_min_cov:+-C "${par_min_cov}"} \ + ${par_max_depth:+-d "${par_max_depth}"} \ + ${par_illumina_13:+--illumina-1.3} \ + ${par_use_orphan:+--use-orphan} \ + ${par_plp_summary_only:+--plp-summary-only} \ + ${par_no_default_filter:+--no-default-filter} \ + ${par_force_overwrite:+--force-overwrite} \ + ${par_verbose:+--verbose} \ + ${par_debug:+--debug} \ + "$par_input" +