From 9147b23d38690890e1f19a06da2b2b05769caf51 Mon Sep 17 00:00:00 2001 From: dorien-er Date: Tue, 27 Feb 2024 15:19:25 +0100 Subject: [PATCH] add all params --- src/multiqc/config.vsh.yaml | 29 +++++++++------ src/multiqc/script.sh | 73 +++++++++++++++++++++++++++++-------- 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/src/multiqc/config.vsh.yaml b/src/multiqc/config.vsh.yaml index 2eb9e673..8db1a53e 100644 --- a/src/multiqc/config.vsh.yaml +++ b/src/multiqc/config.vsh.yaml @@ -19,7 +19,7 @@ functionality: - name: "--input" type: file multiple: true - multiple_sep: ":" + multiple_sep: "," example: data/results/ description: | File paths to be searched for analysis results to be included in the report. @@ -53,20 +53,24 @@ functionality: - name: "--include_modules" type: string multiple: true + multiple_sep: "," example: fastqc,cutadapt description: Use only these module - name: "--exclude_modules" type: string multiple: true + multiple_sep: "," example: fastqc,cutadapt description: Do not use only these modules - name: "--ignore_analysis" type: string multiple: true + multiple_sep: "," example: run_one/*,run_two/* - name: "--ignore_samples" type: string multiple: true + multiple_sep: "," example: sample_1*,sample_3* - name: "--ignore_symlinks" type: boolean_true @@ -95,31 +99,32 @@ functionality: arguments: - name: "--title" type: string - description: Report title. Printed as page header, used for filename if not otherwise specified. + description: | + Report title. Printed as page header, used for filename if not otherwise specified. - name: "--comment" type: string - description: Custom comment, will be printed at the top of the report. + description: | + Custom comment, will be printed at the top of the report. - name: "--template" type: string choices: [default, gathered, geo, highcharts, sections, simple] - description: Report template to use. + description: | + Report template to use. - name: "--sample_names" type: file - description: TSV file containing alternative sample names for renaming buttons in the report. + description: | + TSV file containing alternative sample names for renaming buttons in the report. example: sample_names.tsv - name: "--sample_filters" type: file - description: TSV file containing show/hide patterns for the report + description: | + TSV file containing show/hide patterns for the report example: sample_filters.tsv - name: "--custom_css_file" type: file - description: Custom CSS file to add to the final report - example: custom_style_sheet.css - - name: "--multiqc_custom_config" - type: file - example: path/to/multiqc_config.yml description: | - Specific config file to load, after those in MultiQC dir / home dir / working dir + Custom CSS file to add to the final report + example: custom_style_sheet.css - name: "--profile_runtime" type: boolean_true description: | diff --git a/src/multiqc/script.sh b/src/multiqc/script.sh index 9ced97de..d92a7275 100644 --- a/src/multiqc/script.sh +++ b/src/multiqc/script.sh @@ -27,39 +27,80 @@ out_dir=$(dirname "$par_output_report") output_report_file=$(basename "$par_output_report") report_name="${output_report_file%.*}" -# echo ============ -# echo $out_dir -# echo $output_report_file -# echo $report_name -# echo ============ - # handle outputs [[ -z "$par_output_report" ]] && no_report=true [[ -z "$par_output_data" ]] && no_data_dir=true [[ ! -z "$par_output_data" ]] && data_dir=true [[ ! -z "$par_output_plots" ]] && export=true -# echo =========== -# echo par_output_data: $par_output_data -# echo data_dir: $data_dir -# echo no_data_dir: $no_data_dir -# echo par_output_report: $par_output_report -# echo no_report: $no_report -# echo =========== - -# allow for multiple inputs +# handle multiples if [[ -n "$par_input" ]]; then - IFS=":" read -ra inputs <<< $par_input + IFS="," read -ra inputs <<< $par_input + unset IFS +fi + +if [[ -z "$par_include_modules" ]]; then + include_modules="" + IFS="," read -ra incl_modules <<< $par_include_modules + for i in "${incl_modules[@]}"; do + include_modules+="--include-modules $i " + done + unset IFS +fi + +if [[ -z "$par_exclude_modules" ]]; then + exclude_modules="" + IFS="," read -ra excl_modules <<< $par_include_modules + for i in "${excl_modules[@]}"; do + exclude_modules+="--exclude-modules $i " + done unset IFS fi +if [[ -z "$par_ignore_analysis" ]]; then + ignore="" + IFS="," read -ra ignore_analysis <<< $par_ignore_analysis + for i in "${ignore_analysis[@]}"; do + ignore+="--ignore $i " + done + unset IFS +fi + +if [[ -z "$par_ignore_samples" ]]; then + ignore_samples="" + IFS="," read -ra ign_samples <<< $par_ignore_samples + for i in "${ign_samples[@]}"; do + ignore_samples+="--ignore-samples $i " + done + unset IFS +fi # run multiqc multiqc \ ${par_output_report:+--filename "$report_name"} \ ${out_dir:+--outdir "$out_dir"} \ ${no_report:+--no-report} \ + ${no_data_dir:+--no-data-dir} \ + ${data_dir:+--data-dir} \ ${export:+--export} \ + ${par_title:+--title "$par_title"} \ + ${par_comment:+--comment "$par_comment"} \ + ${par_template:+--template "$par_template"} \ + ${par_sample_names:+--sample-names "$par_sample_names"} \ + ${par_sample_filters:+--sample-filters "$par_sample_filters"} \ + ${par_custom_css_file:+--custom-css-file "$par_custom_css_file"} \ + ${par_profile_runtime:+--profile-runtime} \ + ${par_dirs:+--dirs} \ + ${par_dirs_depth:+--dirs-depth "$par_dirs_depth"} \ + ${par_full_names:+--full-names} \ + ${par_fn_as_s_name:+--fn-as-s-name} \ + ${par_ignore_names:+--ignore-names "$par_ignore_names"} \ + ${par_ignore_symlinks:+--ignore-symlinks} \ + ${ignore_samples:+"$ignore_samples"} \ + ${ignore:+"$ignore"} \ + ${exclude_modules:+"$exclude_modules"} \ + ${include_modules:+"$include_modules"} \ + ${par_include_modules:+--include-modules "$par_include_modules"} \ ${par_data_format:+--data-format "$par_data_format"} \ ${par_zip_data_dir:+--zip-data-dir} \ ${par_pdf:+--pdf} \