diff --git a/src/qualimap/qualimap_rnaseq/config.vsh.yaml b/src/qualimap/qualimap_rnaseq/config.vsh.yaml index d2c28e61..20cf117f 100644 --- a/src/qualimap/qualimap_rnaseq/config.vsh.yaml +++ b/src/qualimap/qualimap_rnaseq/config.vsh.yaml @@ -21,32 +21,22 @@ argument_groups: - name: "Output" arguments: - - name: "--output_dir" + - name: "--output" direction: output type: file - required: false - default: $id.qualimap_output - description: path to output directory for raw data and report. - - name: "--output_pdf" - type: file - direction: output - required: false - must_exist: false - default: $id.report.pdf - description: path to output file for pdf report. - - name: "--output_format" - type: string - required: false - default: html - description: Format of the output report (PDF or HTML, default is HTML) + required: true + example: rnaseq_qc_results.txt + description: Text file containing the RNAseq QC results. - name: "--output_counts" type: file required: false - description: Output file for computed counts. If only name of the file is provided, then the file will be saved in the output folder. - - name: "--output_file" + direction: output + description: Output file for computed counts. + - name: "--output_report" type: file + direction: output required: false - description: Output file for PDF report (default value is report.pdf). + description: PDF report output file. - name: "Optional" arguments: @@ -86,6 +76,7 @@ argument_groups: default: 4G description: maximum Java heap memory size, default = 4G. + resources: - type: bash_script path: script.sh diff --git a/src/qualimap/qualimap_rnaseq/script.sh b/src/qualimap/qualimap_rnaseq/script.sh index cfb9f016..5f9cfb49 100644 --- a/src/qualimap/qualimap_rnaseq/script.sh +++ b/src/qualimap/qualimap_rnaseq/script.sh @@ -1,22 +1,37 @@ #!/bin/bash -sleep 10000 - set -eo pipefail -mkdir -p $par_output_dir +tmp_dir=$(mktemp -d -p "$meta_temp_dir" qualimap_XXXXXXXXX) + + +if [ -n "$par_output_file" ]; then + outfile=$(basename "$par_output_file") +fi + +if [ -n "$par_output_counts" ]; then + counts=$(basename "$par_output_counts") +fi qualimap rnaseq \ - # --algorithm=$par_algorithm \ --java-mem-size=$par_java_memory_size \ + --algorithm $par_algorithm \ --num-pr-bases $par_pr_bases \ --num-tr-bias $par_tr_bias \ --sequencing-protocol $par_sequencing_protocol \ -bam $par_input \ -gtf $par_gtf \ - ${par_paired:+-pe} \ - ${par_sorted:+-s} \ - -outdir $par_output_dir \ - # -oc $par_output_counts \ - # -outfile $par_output_file \ - -outformat $par_output_format + -outdir "$tmp_dir" \ + -outformat pdf \ + ${par_output_file:+-outfile "$outfile"} \ + ${par_output_counts:+-oc "$counts"} + +mv "$tmp_dir/rnaseq_qc_results.txt" "$par_output" + +if [ -n "$par_output_file" ]; then + mv "$tmp_dir/$outfile" "$par_output_file" +fi + +if [ -n "$par_output_counts" ]; then + mv "$tmp_dir/$counts" "$par_output_counts" +fi