From ce3c3eb442299dddbef89865063fc981d395a1cc Mon Sep 17 00:00:00 2001 From: CI Date: Thu, 19 Dec 2024 15:54:37 +0000 Subject: [PATCH] Build branch main with version main (798e361) Build pipeline: viash-hub.demultiplex.main-plzkv Source commit: https://github.com/viash-hub/demultiplex/commit/798e361afeea8dbb84dc23ef38e4fbc3883463e7 Source message: Add run information to output (#31) --- CHANGELOG.md | 4 + src/demultiplex/config.vsh.yaml | 5 + src/demultiplex/main.nf | 3 +- src/demultiplex/test.nf | 20 ++++ src/io/publish/code.sh | 42 +++---- src/io/publish/config.vsh.yaml | 10 +- src/runner/main.nf | 27 +++-- .../interop_summary_to_csv/.config.vsh.yaml | 6 +- .../interop_summary_to_csv | 4 +- target/executable/io/publish/.config.vsh.yaml | 29 ++++- target/executable/io/publish/publish | 113 ++++++++++++++---- target/executable/io/untar/.config.vsh.yaml | 6 +- target/executable/io/untar/untar | 4 +- .../dataflow/combine_samples/.config.vsh.yaml | 6 +- .../nextflow/dataflow/combine_samples/main.nf | 6 +- .../.config.vsh.yaml | 6 +- .../gather_fastqs_and_validate/main.nf | 6 +- target/nextflow/demultiplex/.config.vsh.yaml | 17 ++- target/nextflow/demultiplex/main.nf | 22 +++- .../nextflow/demultiplex/nextflow_schema.json | 11 ++ .../interop_summary_to_csv/.config.vsh.yaml | 6 +- .../io/interop_summary_to_csv/main.nf | 6 +- target/nextflow/io/publish/.config.vsh.yaml | 29 ++++- target/nextflow/io/publish/main.nf | 76 +++++++----- .../nextflow/io/publish/nextflow_schema.json | 25 +++- target/nextflow/io/untar/.config.vsh.yaml | 6 +- target/nextflow/io/untar/main.nf | 6 +- target/nextflow/runner/.config.vsh.yaml | 6 +- target/nextflow/runner/main.nf | 33 +++-- 29 files changed, 387 insertions(+), 153 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d3f40b..5f9d989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ $publish_dir └── 200624_A00834_0183_BHMTFYDRXX └── 20241217_051404_demultiplex_v1.2 + ├── run_information.csv ├── fastq │   ├── Sample1_S1_L001_R1_001.fastq.gz │   ├── Sample23_S3_L001_R1_001.fastq.gz @@ -48,6 +49,9 @@ - This logic can be avoided by providing the flag `--plain_output`. +# Minor updates + +* Added `output_run_information` argument that copies the run information file to the output (PR #31). # demultiplex v0.3.2 diff --git a/src/demultiplex/config.vsh.yaml b/src/demultiplex/config.vsh.yaml index 73ca153..07c5916 100644 --- a/src/demultiplex/config.vsh.yaml +++ b/src/demultiplex/config.vsh.yaml @@ -48,6 +48,11 @@ argument_groups: direction: output required: false default: "$id/qc/multiqc_report.html" + - name: "--output_run_information" + type: file + direction: "output" + required: true + default: "$id/run_information.csv" resources: - type: nextflow_script path: main.nf diff --git a/src/demultiplex/main.nf b/src/demultiplex/main.nf index 470fbd8..6c10bdc 100644 --- a/src/demultiplex/main.nf +++ b/src/demultiplex/main.nf @@ -225,7 +225,8 @@ workflow run_wf { //"_meta": "_meta", "output": "output_demultiplexer", "output_falco": "output_falco", - "output_multiqc": "output_multiqc" + "output_multiqc": "output_multiqc", + "output_run_information": "run_information", ] ) diff --git a/src/demultiplex/test.nf b/src/demultiplex/test.nf index 92d708d..562fbbd 100644 --- a/src/demultiplex/test.nf +++ b/src/demultiplex/test.nf @@ -35,6 +35,26 @@ workflow test_illumina { fastq_files.each{ assert it.length() != 0: "Expected FASTQ file to not be empty" } + assert state.output_run_information.isFile(): "Expected output run information to be a file" + expected_run_information = """[Header] + |Date,6/24/2020 + |Application,Illumina DRAGEN COVIDSeq Test Pipeline + |Instrument Type,NovaSeq6000 + |Assay,Illumina COVIDSeq Test + |Index Adapters,IDT-ILMN DNA-RNA UDP Indexes + |Chemistry,Amplicon + + |[Settings] + |AdapterRead1,CTGTCTCTTATACACATCT + + |[Data] + |Lane,Sample_ID,Sample_Type,Index_ID,Index,Index2 + |1,Sample1,PatientSample,UDP0001,GAACTGAGCG,TCGTGGAGCG + |1,SampleA,PatientSample,UDP0002,AGGTCAGATA,CTACAAGATA + |1,Sample23,PatientSample,UDP0003,CGTCTCATAT,TATAGTAGCT + |1,sampletest,PatientSample,UDP0004,ATTCCATAAG,TGCCTGGTGG + |""".stripMargin() + assert state.output_run_information.text.replaceAll("\r\n", "\n") == expected_run_information } } diff --git a/src/io/publish/code.sh b/src/io/publish/code.sh index 76927a7..cb4a7a9 100755 --- a/src/io/publish/code.sh +++ b/src/io/publish/code.sh @@ -1,30 +1,26 @@ #!/bin/bash -echo "Publishing $par_input -> $par_output" -echo "Publishing $par_input_falco -> $par_output_falco" -echo "Publishing $par_input_multiqc -> $par_output_multiqc" +set -eo pipefail -echo -echo "Creating directory if it does not exist:" -mkdir -p $(dirname "$par_output") && echo "Containing directory $par_output created" -mkdir -p $(dirname "$par_output_falco") && echo "Containing directory $par_output_falco created" -mkdir -p $(dirname "$par_output_multiqc") && echo "Containing directory $par_output_multiqc created" +declare -A input_output_mapping=(["par_input"]="par_output" + ["par_input_falco"]="par_output_falco" + ["par_input_multiqc"]="par_output_multiqc" + ["par_input_run_information"]="par_output_run_information" + ) -echo -echo "Copying files..." -cp -rL "$par_input" "$par_output" -cp -rL "$par_input_falco" "$par_output_falco" -cp -rL "$par_input_multiqc" "$par_output_multiqc" +for input_argument_name in "${!input_output_mapping[@]}" +do + input_location="${!input_argument_name}" + output_argument_name="${input_output_mapping[$input_argument_name]}" + output_location="${!output_argument_name}" + echo "Publishing $input_location -> $output_location" -echo -echo "Output files:" -echo "par_output:" -ls "$par_output" + echo "Creating directory if it does not exist." + mkdir -p $(dirname "$output_location") && echo "Containing directory $output_location created" -echo -echo "par_output_falco:" -ls "$par_output_falco" + echo "Copying files..." + cp -rL "$input_location" "$output_location" -echo -echo "par_output_multiqc:" -ls "$par_output_multiqc" + echo "Output files for $output_location:" + ls "$output_location" +done \ No newline at end of file diff --git a/src/io/publish/config.vsh.yaml b/src/io/publish/config.vsh.yaml index 5683dc2..ce5e95a 100644 --- a/src/io/publish/config.vsh.yaml +++ b/src/io/publish/config.vsh.yaml @@ -13,7 +13,11 @@ argument_groups: type: file required: true - name: "--input_multiqc" - description: Directory to write falco output to + description: Location where to write the MultiQC report to. + type: file + required: true + - name: "--input_run_information" + description: "Location where to write the run information to." type: file required: true - name: Output arguments @@ -30,6 +34,10 @@ argument_groups: type: file direction: output default: "qc/multiqc_report.html" + - name: --output_run_information + type: file + direction: output + default: run_information.csv resources: - type: bash_script diff --git a/src/runner/main.nf b/src/runner/main.nf index ef78f71..c705a09 100644 --- a/src/runner/main.nf +++ b/src/runner/main.nf @@ -19,14 +19,20 @@ workflow run_wf { ] } | demultiplex.run( - fromState: [ - "input": "input", - "run_information": "run_information", - "demultiplexer": "demultiplexer", - "output": "fastq", - "output_falco": "qc/fastqc", - "output_multiqc": "qc/multiqc_report.html" - ], + fromState: { id, state -> + def state_to_pass = [ + "input": state.input, + "run_information": state.run_information, + "demultiplexer": state.demultiplexer, + "output": "fastq", + "output_falco": "qc/fastqc", + "output_multiqc": "qc/multiqc_report.html", + ] + if (state.run_information) { + state_to_pass += ["output_run_information": state.run_information.getName()] + } + state_to_pass + }, toState: { id, result, state -> state + result }, @@ -40,6 +46,7 @@ workflow run_wf { def fastq_output_1 = (id2 == "run") ? state.fastq_output : "${id2}/" + state.fastq_output def falco_output_1 = (id2 == "run") ? state.falco_output : "${id2}/" + state.falco_output def multiqc_output_1 = (id2 == "run") ? state.multiqc_output : "${id2}/" + state.multiqc_output + def run_information_output_1 = (id2 == "run") ? "${state.output_run_information.getName()}" : "${id2}/${state.output_run_information.getName()}" if (id2 == "run") { println("Publising to ${params.publish_dir}") @@ -51,9 +58,11 @@ workflow run_wf { input: state.output, input_falco: state.output_falco, input_multiqc: state.output_multiqc, + input_run_information: state.output_run_information, output: fastq_output_1, output_falco: falco_output_1, - output_multiqc: multiqc_output_1 + output_multiqc: multiqc_output_1, + output_run_information: run_information_output_1, ] }, toState: { id, result, state -> [:] }, diff --git a/target/executable/io/interop_summary_to_csv/.config.vsh.yaml b/target/executable/io/interop_summary_to_csv/.config.vsh.yaml index bdbd0c9..75401bb 100644 --- a/target/executable/io/interop_summary_to_csv/.config.vsh.yaml +++ b/target/executable/io/interop_summary_to_csv/.config.vsh.yaml @@ -141,9 +141,9 @@ build_info: output: "target/executable/io/interop_summary_to_csv" executable: "target/executable/io/interop_summary_to_csv/interop_summary_to_csv" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/executable/io/interop_summary_to_csv/interop_summary_to_csv b/target/executable/io/interop_summary_to_csv/interop_summary_to_csv index 7190766..109d9bc 100755 --- a/target/executable/io/interop_summary_to_csv/interop_summary_to_csv +++ b/target/executable/io/interop_summary_to_csv/interop_summary_to_csv @@ -470,9 +470,9 @@ tar -C /tmp/ --no-same-owner --no-same-permissions -xvf /tmp/interop.tar.gz && \ mv /tmp/interop-1.3.1-Linux-GNU/bin/index-summary /tmp/interop-1.3.1-Linux-GNU/bin/summary /usr/local/bin/ LABEL org.opencontainers.image.description="Companion container for running component io interop_summary_to_csv" -LABEL org.opencontainers.image.created="2024-12-18T15:00:53Z" +LABEL org.opencontainers.image.created="2024-12-19T15:39:33Z" LABEL org.opencontainers.image.source="https://github.com/viash-hub/demultiplex" -LABEL org.opencontainers.image.revision="8d3c2888d6df6688763d303dba03ce53d339fb0f" +LABEL org.opencontainers.image.revision="798e361afeea8dbb84dc23ef38e4fbc3883463e7" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/io/publish/.config.vsh.yaml b/target/executable/io/publish/.config.vsh.yaml index a941315..827c62f 100644 --- a/target/executable/io/publish/.config.vsh.yaml +++ b/target/executable/io/publish/.config.vsh.yaml @@ -26,7 +26,17 @@ argument_groups: multiple_sep: ";" - type: "file" name: "--input_multiqc" - description: "Directory to write falco output to" + description: "Location where to write the MultiQC report to." + info: null + must_exist: true + create_parent: true + required: true + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--input_run_information" + description: "Location where to write the run information to." info: null must_exist: true create_parent: true @@ -69,6 +79,17 @@ argument_groups: direction: "output" multiple: false multiple_sep: ";" + - type: "file" + name: "--output_run_information" + info: null + default: + - "run_information.csv" + must_exist: true + create_parent: true + required: false + direction: "output" + multiple: false + multiple_sep: ";" resources: - type: "bash_script" path: "code.sh" @@ -170,9 +191,9 @@ build_info: output: "target/executable/io/publish" executable: "target/executable/io/publish/publish" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/executable/io/publish/publish b/target/executable/io/publish/publish index e2b3070..8faba5d 100755 --- a/target/executable/io/publish/publish +++ b/target/executable/io/publish/publish @@ -186,7 +186,11 @@ function ViashHelp { echo "" echo " --input_multiqc" echo " type: file, required parameter, file must exist" - echo " Directory to write falco output to" + echo " Location where to write the MultiQC report to." + echo "" + echo " --input_run_information" + echo " type: file, required parameter, file must exist" + echo " Location where to write the run information to." echo "" echo "Output arguments:" echo " --output" @@ -200,6 +204,10 @@ function ViashHelp { echo " --output_multiqc" echo " type: file, output, file must exist" echo " default: qc/multiqc_report.html" + echo "" + echo " --output_run_information" + echo " type: file, output, file must exist" + echo " default: run_information.csv" } # initialise variables @@ -482,9 +490,9 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* LABEL org.opencontainers.image.description="Companion container for running component io publish" -LABEL org.opencontainers.image.created="2024-12-18T15:00:54Z" +LABEL org.opencontainers.image.created="2024-12-19T15:39:33Z" LABEL org.opencontainers.image.source="https://github.com/viash-hub/demultiplex" -LABEL org.opencontainers.image.revision="8d3c2888d6df6688763d303dba03ce53d339fb0f" +LABEL org.opencontainers.image.revision="798e361afeea8dbb84dc23ef38e4fbc3883463e7" LABEL org.opencontainers.image.version="main" VIASHDOCKER @@ -657,6 +665,17 @@ while [[ $# -gt 0 ]]; do VIASH_PAR_INPUT_MULTIQC=$(ViashRemoveFlags "$1") shift 1 ;; + --input_run_information) + [ -n "$VIASH_PAR_INPUT_RUN_INFORMATION" ] && ViashError Bad arguments for option \'--input_run_information\': \'$VIASH_PAR_INPUT_RUN_INFORMATION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_RUN_INFORMATION="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --input_run_information. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --input_run_information=*) + [ -n "$VIASH_PAR_INPUT_RUN_INFORMATION" ] && ViashError Bad arguments for option \'--input_run_information=*\': \'$VIASH_PAR_INPUT_RUN_INFORMATION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_INPUT_RUN_INFORMATION=$(ViashRemoveFlags "$1") + shift 1 + ;; --output) [ -n "$VIASH_PAR_OUTPUT" ] && ViashError Bad arguments for option \'--output\': \'$VIASH_PAR_OUTPUT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 VIASH_PAR_OUTPUT="$2" @@ -690,6 +709,17 @@ while [[ $# -gt 0 ]]; do VIASH_PAR_OUTPUT_MULTIQC=$(ViashRemoveFlags "$1") shift 1 ;; + --output_run_information) + [ -n "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ] && ViashError Bad arguments for option \'--output_run_information\': \'$VIASH_PAR_OUTPUT_RUN_INFORMATION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OUTPUT_RUN_INFORMATION="$2" + [ $# -lt 2 ] && ViashError Not enough arguments passed to --output_run_information. Use "--help" to get more information on the parameters. && exit 1 + shift 2 + ;; + --output_run_information=*) + [ -n "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ] && ViashError Bad arguments for option \'--output_run_information=*\': \'$VIASH_PAR_OUTPUT_RUN_INFORMATION\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 + VIASH_PAR_OUTPUT_RUN_INFORMATION=$(ViashRemoveFlags "$1") + shift 1 + ;; ---engine) VIASH_ENGINE_ID="$2" shift 2 @@ -874,6 +904,10 @@ if [ -z ${VIASH_PAR_INPUT_MULTIQC+x} ]; then ViashError '--input_multiqc' is a required argument. Use "--help" to get more information on the parameters. exit 1 fi +if [ -z ${VIASH_PAR_INPUT_RUN_INFORMATION+x} ]; then + ViashError '--input_run_information' is a required argument. Use "--help" to get more information on the parameters. + exit 1 +fi if [ -z ${VIASH_META_NAME+x} ]; then ViashError 'name' is a required argument. Use "--help" to get more information on the parameters. exit 1 @@ -909,6 +943,9 @@ fi if [ -z ${VIASH_PAR_OUTPUT_MULTIQC+x} ]; then VIASH_PAR_OUTPUT_MULTIQC="qc/multiqc_report.html" fi +if [ -z ${VIASH_PAR_OUTPUT_RUN_INFORMATION+x} ]; then + VIASH_PAR_OUTPUT_RUN_INFORMATION="run_information.csv" +fi # check whether required files exist if [ ! -z "$VIASH_PAR_INPUT" ] && [ ! -e "$VIASH_PAR_INPUT" ]; then @@ -923,6 +960,10 @@ if [ ! -z "$VIASH_PAR_INPUT_MULTIQC" ] && [ ! -e "$VIASH_PAR_INPUT_MULTIQC" ]; t ViashError "Input file '$VIASH_PAR_INPUT_MULTIQC' does not exist." exit 1 fi +if [ ! -z "$VIASH_PAR_INPUT_RUN_INFORMATION" ] && [ ! -e "$VIASH_PAR_INPUT_RUN_INFORMATION" ]; then + ViashError "Input file '$VIASH_PAR_INPUT_RUN_INFORMATION' does not exist." + exit 1 +fi # check whether parameters values are of the right type if [[ -n "$VIASH_META_CPUS" ]]; then @@ -1008,6 +1049,9 @@ fi if [ ! -z "$VIASH_PAR_OUTPUT_MULTIQC" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_MULTIQC")" ]; then mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_MULTIQC")" fi +if [ ! -z "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ] && [ ! -d "$(dirname "$VIASH_PAR_OUTPUT_RUN_INFORMATION")" ]; then + mkdir -p "$(dirname "$VIASH_PAR_OUTPUT_RUN_INFORMATION")" +fi if [ "$VIASH_ENGINE_ID" == "native" ] ; then if [ "$VIASH_MODE" == "run" ]; then @@ -1033,6 +1077,10 @@ if [ ! -z "$VIASH_PAR_INPUT_MULTIQC" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT_MULTIQC")" ) VIASH_PAR_INPUT_MULTIQC=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT_MULTIQC") fi +if [ ! -z "$VIASH_PAR_INPUT_RUN_INFORMATION" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_INPUT_RUN_INFORMATION")" ) + VIASH_PAR_INPUT_RUN_INFORMATION=$(ViashDockerAutodetectMount "$VIASH_PAR_INPUT_RUN_INFORMATION") +fi if [ ! -z "$VIASH_PAR_OUTPUT" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_OUTPUT")" ) VIASH_PAR_OUTPUT=$(ViashDockerAutodetectMount "$VIASH_PAR_OUTPUT") @@ -1048,6 +1096,11 @@ if [ ! -z "$VIASH_PAR_OUTPUT_MULTIQC" ]; then VIASH_PAR_OUTPUT_MULTIQC=$(ViashDockerAutodetectMount "$VIASH_PAR_OUTPUT_MULTIQC") VIASH_CHOWN_VARS+=( "$VIASH_PAR_OUTPUT_MULTIQC" ) fi +if [ ! -z "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ]; then + VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_PAR_OUTPUT_RUN_INFORMATION")" ) + VIASH_PAR_OUTPUT_RUN_INFORMATION=$(ViashDockerAutodetectMount "$VIASH_PAR_OUTPUT_RUN_INFORMATION") + VIASH_CHOWN_VARS+=( "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ) +fi if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then VIASH_DIRECTORY_MOUNTS+=( "$(ViashDockerAutodetectMountArg "$VIASH_META_RESOURCES_DIR")" ) VIASH_META_RESOURCES_DIR=$(ViashDockerAutodetectMount "$VIASH_META_RESOURCES_DIR") @@ -1120,9 +1173,11 @@ cat > "\$tempscript" << 'VIASHMAIN' $( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi ) $( if [ ! -z ${VIASH_PAR_INPUT_FALCO+x} ]; then echo "${VIASH_PAR_INPUT_FALCO}" | sed "s#'#'\"'\"'#g;s#.*#par_input_falco='&'#" ; else echo "# par_input_falco="; fi ) $( if [ ! -z ${VIASH_PAR_INPUT_MULTIQC+x} ]; then echo "${VIASH_PAR_INPUT_MULTIQC}" | sed "s#'#'\"'\"'#g;s#.*#par_input_multiqc='&'#" ; else echo "# par_input_multiqc="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_RUN_INFORMATION+x} ]; then echo "${VIASH_PAR_INPUT_RUN_INFORMATION}" | sed "s#'#'\"'\"'#g;s#.*#par_input_run_information='&'#" ; else echo "# par_input_run_information="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "${VIASH_PAR_OUTPUT}" | sed "s#'#'\"'\"'#g;s#.*#par_output='&'#" ; else echo "# par_output="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT_FALCO+x} ]; then echo "${VIASH_PAR_OUTPUT_FALCO}" | sed "s#'#'\"'\"'#g;s#.*#par_output_falco='&'#" ; else echo "# par_output_falco="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT_MULTIQC+x} ]; then echo "${VIASH_PAR_OUTPUT_MULTIQC}" | sed "s#'#'\"'\"'#g;s#.*#par_output_multiqc='&'#" ; else echo "# par_output_multiqc="; fi ) +$( if [ ! -z ${VIASH_PAR_OUTPUT_RUN_INFORMATION+x} ]; then echo "${VIASH_PAR_OUTPUT_RUN_INFORMATION}" | sed "s#'#'\"'\"'#g;s#.*#par_output_run_information='&'#" ; else echo "# par_output_run_information="; fi ) $( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) $( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\"'\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) $( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\"'\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) @@ -1145,34 +1200,30 @@ $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" ## VIASH END #!/bin/bash -echo "Publishing \$par_input -> \$par_output" -echo "Publishing \$par_input_falco -> \$par_output_falco" -echo "Publishing \$par_input_multiqc -> \$par_output_multiqc" +set -eo pipefail -echo -echo "Creating directory if it does not exist:" -mkdir -p \$(dirname "\$par_output") && echo "Containing directory \$par_output created" -mkdir -p \$(dirname "\$par_output_falco") && echo "Containing directory \$par_output_falco created" -mkdir -p \$(dirname "\$par_output_multiqc") && echo "Containing directory \$par_output_multiqc created" +declare -A input_output_mapping=(["par_input"]="par_output" + ["par_input_falco"]="par_output_falco" + ["par_input_multiqc"]="par_output_multiqc" + ["par_input_run_information"]="par_output_run_information" + ) -echo -echo "Copying files..." -cp -rL "\$par_input" "\$par_output" -cp -rL "\$par_input_falco" "\$par_output_falco" -cp -rL "\$par_input_multiqc" "\$par_output_multiqc" +for input_argument_name in "\${!input_output_mapping[@]}" +do + input_location="\${!input_argument_name}" + output_argument_name="\${input_output_mapping[\$input_argument_name]}" + output_location="\${!output_argument_name}" + echo "Publishing \$input_location -> \$output_location" -echo -echo "Output files:" -echo "par_output:" -ls "\$par_output" + echo "Creating directory if it does not exist." + mkdir -p \$(dirname "\$output_location") && echo "Containing directory \$output_location created" -echo -echo "par_output_falco:" -ls "\$par_output_falco" + echo "Copying files..." + cp -rL "\$input_location" "\$output_location" -echo -echo "par_output_multiqc:" -ls "\$par_output_multiqc" + echo "Output files for \$output_location:" + ls "\$output_location" +done VIASHMAIN bash "\$tempscript" & wait "\$!" @@ -1192,6 +1243,9 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then if [ ! -z "$VIASH_PAR_INPUT_MULTIQC" ]; then VIASH_PAR_INPUT_MULTIQC=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT_MULTIQC") fi + if [ ! -z "$VIASH_PAR_INPUT_RUN_INFORMATION" ]; then + VIASH_PAR_INPUT_RUN_INFORMATION=$(ViashDockerStripAutomount "$VIASH_PAR_INPUT_RUN_INFORMATION") + fi if [ ! -z "$VIASH_PAR_OUTPUT" ]; then VIASH_PAR_OUTPUT=$(ViashDockerStripAutomount "$VIASH_PAR_OUTPUT") fi @@ -1201,6 +1255,9 @@ if [[ "$VIASH_ENGINE_TYPE" == "docker" ]]; then if [ ! -z "$VIASH_PAR_OUTPUT_MULTIQC" ]; then VIASH_PAR_OUTPUT_MULTIQC=$(ViashDockerStripAutomount "$VIASH_PAR_OUTPUT_MULTIQC") fi + if [ ! -z "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ]; then + VIASH_PAR_OUTPUT_RUN_INFORMATION=$(ViashDockerStripAutomount "$VIASH_PAR_OUTPUT_RUN_INFORMATION") + fi if [ ! -z "$VIASH_META_RESOURCES_DIR" ]; then VIASH_META_RESOURCES_DIR=$(ViashDockerStripAutomount "$VIASH_META_RESOURCES_DIR") fi @@ -1229,6 +1286,10 @@ if [ ! -z "$VIASH_PAR_OUTPUT_MULTIQC" ] && [ ! -e "$VIASH_PAR_OUTPUT_MULTIQC" ]; ViashError "Output file '$VIASH_PAR_OUTPUT_MULTIQC' does not exist." exit 1 fi +if [ ! -z "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ] && [ ! -e "$VIASH_PAR_OUTPUT_RUN_INFORMATION" ]; then + ViashError "Output file '$VIASH_PAR_OUTPUT_RUN_INFORMATION' does not exist." + exit 1 +fi exit 0 diff --git a/target/executable/io/untar/.config.vsh.yaml b/target/executable/io/untar/.config.vsh.yaml index a0857e0..58335da 100644 --- a/target/executable/io/untar/.config.vsh.yaml +++ b/target/executable/io/untar/.config.vsh.yaml @@ -148,9 +148,9 @@ build_info: output: "target/executable/io/untar" executable: "target/executable/io/untar/untar" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/executable/io/untar/untar b/target/executable/io/untar/untar index 56a99cd..59f1797 100755 --- a/target/executable/io/untar/untar +++ b/target/executable/io/untar/untar @@ -476,9 +476,9 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* LABEL org.opencontainers.image.description="Companion container for running component io untar" -LABEL org.opencontainers.image.created="2024-12-18T15:00:54Z" +LABEL org.opencontainers.image.created="2024-12-19T15:39:34Z" LABEL org.opencontainers.image.source="https://github.com/viash-hub/demultiplex" -LABEL org.opencontainers.image.revision="8d3c2888d6df6688763d303dba03ce53d339fb0f" +LABEL org.opencontainers.image.revision="798e361afeea8dbb84dc23ef38e4fbc3883463e7" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/nextflow/dataflow/combine_samples/.config.vsh.yaml b/target/nextflow/dataflow/combine_samples/.config.vsh.yaml index 08404f6..f7445e1 100644 --- a/target/nextflow/dataflow/combine_samples/.config.vsh.yaml +++ b/target/nextflow/dataflow/combine_samples/.config.vsh.yaml @@ -139,9 +139,9 @@ build_info: output: "target/nextflow/dataflow/combine_samples" executable: "target/nextflow/dataflow/combine_samples/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/nextflow/dataflow/combine_samples/main.nf b/target/nextflow/dataflow/combine_samples/main.nf index 61a5fbc..0fb8f93 100644 --- a/target/nextflow/dataflow/combine_samples/main.nf +++ b/target/nextflow/dataflow/combine_samples/main.nf @@ -2972,9 +2972,9 @@ meta = [ "engine" : "native|native", "output" : "target/nextflow/dataflow/combine_samples", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", diff --git a/target/nextflow/dataflow/gather_fastqs_and_validate/.config.vsh.yaml b/target/nextflow/dataflow/gather_fastqs_and_validate/.config.vsh.yaml index 1b9fc4a..059869c 100644 --- a/target/nextflow/dataflow/gather_fastqs_and_validate/.config.vsh.yaml +++ b/target/nextflow/dataflow/gather_fastqs_and_validate/.config.vsh.yaml @@ -133,9 +133,9 @@ build_info: output: "target/nextflow/dataflow/gather_fastqs_and_validate" executable: "target/nextflow/dataflow/gather_fastqs_and_validate/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/nextflow/dataflow/gather_fastqs_and_validate/main.nf b/target/nextflow/dataflow/gather_fastqs_and_validate/main.nf index fb6bd13..64376c3 100644 --- a/target/nextflow/dataflow/gather_fastqs_and_validate/main.nf +++ b/target/nextflow/dataflow/gather_fastqs_and_validate/main.nf @@ -2965,9 +2965,9 @@ meta = [ "engine" : "native|native", "output" : "target/nextflow/dataflow/gather_fastqs_and_validate", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", diff --git a/target/nextflow/demultiplex/.config.vsh.yaml b/target/nextflow/demultiplex/.config.vsh.yaml index 846a585..54c9e44 100644 --- a/target/nextflow/demultiplex/.config.vsh.yaml +++ b/target/nextflow/demultiplex/.config.vsh.yaml @@ -85,6 +85,17 @@ argument_groups: direction: "output" multiple: false multiple_sep: ";" + - type: "file" + name: "--output_run_information" + info: null + default: + - "$id/run_information.csv" + must_exist: true + create_parent: true + required: true + direction: "output" + multiple: false + multiple_sep: ";" resources: - type: "nextflow_script" path: "main.nf" @@ -220,9 +231,9 @@ build_info: output: "target/nextflow/demultiplex" executable: "target/nextflow/demultiplex/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" dependencies: - "target/nextflow/io/untar" - "target/nextflow/dataflow/gather_fastqs_and_validate" diff --git a/target/nextflow/demultiplex/main.nf b/target/nextflow/demultiplex/main.nf index 2de6cb9..3fa9980 100644 --- a/target/nextflow/demultiplex/main.nf +++ b/target/nextflow/demultiplex/main.nf @@ -2900,6 +2900,19 @@ meta = [ "direction" : "output", "multiple" : false, "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--output_run_information", + "default" : [ + "$id/run_information.csv" + ], + "must_exist" : true, + "create_parent" : true, + "required" : true, + "direction" : "output", + "multiple" : false, + "multiple_sep" : ";" } ] } @@ -3088,9 +3101,9 @@ meta = [ "engine" : "native|native", "output" : "target/nextflow/demultiplex", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", @@ -3369,7 +3382,8 @@ workflow run_wf { //"_meta": "_meta", "output": "output_demultiplexer", "output_falco": "output_falco", - "output_multiqc": "output_multiqc" + "output_multiqc": "output_multiqc", + "output_run_information": "run_information", ] ) diff --git a/target/nextflow/demultiplex/nextflow_schema.json b/target/nextflow/demultiplex/nextflow_schema.json index a54f285..89ec597 100644 --- a/target/nextflow/demultiplex/nextflow_schema.json +++ b/target/nextflow/demultiplex/nextflow_schema.json @@ -98,6 +98,17 @@ } + , + "output_run_information": { + "type": + "string", + "description": "Type: `file`, required, default: `$id.$key.output_run_information.csv`. ", + "help_text": "Type: `file`, required, default: `$id.$key.output_run_information.csv`. " + , + "default":"$id.$key.output_run_information.csv" + } + + } }, diff --git a/target/nextflow/io/interop_summary_to_csv/.config.vsh.yaml b/target/nextflow/io/interop_summary_to_csv/.config.vsh.yaml index 6b517d3..f3b5b12 100644 --- a/target/nextflow/io/interop_summary_to_csv/.config.vsh.yaml +++ b/target/nextflow/io/interop_summary_to_csv/.config.vsh.yaml @@ -141,9 +141,9 @@ build_info: output: "target/nextflow/io/interop_summary_to_csv" executable: "target/nextflow/io/interop_summary_to_csv/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/nextflow/io/interop_summary_to_csv/main.nf b/target/nextflow/io/interop_summary_to_csv/main.nf index 4fed0dd..e613756 100644 --- a/target/nextflow/io/interop_summary_to_csv/main.nf +++ b/target/nextflow/io/interop_summary_to_csv/main.nf @@ -2977,9 +2977,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/io/interop_summary_to_csv", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", diff --git a/target/nextflow/io/publish/.config.vsh.yaml b/target/nextflow/io/publish/.config.vsh.yaml index a21fb44..36941ac 100644 --- a/target/nextflow/io/publish/.config.vsh.yaml +++ b/target/nextflow/io/publish/.config.vsh.yaml @@ -26,7 +26,17 @@ argument_groups: multiple_sep: ";" - type: "file" name: "--input_multiqc" - description: "Directory to write falco output to" + description: "Location where to write the MultiQC report to." + info: null + must_exist: true + create_parent: true + required: true + direction: "input" + multiple: false + multiple_sep: ";" + - type: "file" + name: "--input_run_information" + description: "Location where to write the run information to." info: null must_exist: true create_parent: true @@ -69,6 +79,17 @@ argument_groups: direction: "output" multiple: false multiple_sep: ";" + - type: "file" + name: "--output_run_information" + info: null + default: + - "run_information.csv" + must_exist: true + create_parent: true + required: false + direction: "output" + multiple: false + multiple_sep: ";" resources: - type: "bash_script" path: "code.sh" @@ -170,9 +191,9 @@ build_info: output: "target/nextflow/io/publish" executable: "target/nextflow/io/publish/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/nextflow/io/publish/main.nf b/target/nextflow/io/publish/main.nf index dd8aa1d..f60bb11 100644 --- a/target/nextflow/io/publish/main.nf +++ b/target/nextflow/io/publish/main.nf @@ -2836,7 +2836,18 @@ meta = [ { "type" : "file", "name" : "--input_multiqc", - "description" : "Directory to write falco output to", + "description" : "Location where to write the MultiQC report to.", + "must_exist" : true, + "create_parent" : true, + "required" : true, + "direction" : "input", + "multiple" : false, + "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--input_run_information", + "description" : "Location where to write the run information to.", "must_exist" : true, "create_parent" : true, "required" : true, @@ -2887,6 +2898,19 @@ meta = [ "direction" : "output", "multiple" : false, "multiple_sep" : ";" + }, + { + "type" : "file", + "name" : "--output_run_information", + "default" : [ + "run_information.csv" + ], + "must_exist" : true, + "create_parent" : true, + "required" : false, + "direction" : "output", + "multiple" : false, + "multiple_sep" : ";" } ] } @@ -3012,9 +3036,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/io/publish", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", @@ -3067,9 +3091,11 @@ cat > "$tempscript" << VIASHMAIN $( if [ ! -z ${VIASH_PAR_INPUT+x} ]; then echo "${VIASH_PAR_INPUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input='&'#" ; else echo "# par_input="; fi ) $( if [ ! -z ${VIASH_PAR_INPUT_FALCO+x} ]; then echo "${VIASH_PAR_INPUT_FALCO}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input_falco='&'#" ; else echo "# par_input_falco="; fi ) $( if [ ! -z ${VIASH_PAR_INPUT_MULTIQC+x} ]; then echo "${VIASH_PAR_INPUT_MULTIQC}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input_multiqc='&'#" ; else echo "# par_input_multiqc="; fi ) +$( if [ ! -z ${VIASH_PAR_INPUT_RUN_INFORMATION+x} ]; then echo "${VIASH_PAR_INPUT_RUN_INFORMATION}" | sed "s#'#'\\"'\\"'#g;s#.*#par_input_run_information='&'#" ; else echo "# par_input_run_information="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT+x} ]; then echo "${VIASH_PAR_OUTPUT}" | sed "s#'#'\\"'\\"'#g;s#.*#par_output='&'#" ; else echo "# par_output="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT_FALCO+x} ]; then echo "${VIASH_PAR_OUTPUT_FALCO}" | sed "s#'#'\\"'\\"'#g;s#.*#par_output_falco='&'#" ; else echo "# par_output_falco="; fi ) $( if [ ! -z ${VIASH_PAR_OUTPUT_MULTIQC+x} ]; then echo "${VIASH_PAR_OUTPUT_MULTIQC}" | sed "s#'#'\\"'\\"'#g;s#.*#par_output_multiqc='&'#" ; else echo "# par_output_multiqc="; fi ) +$( if [ ! -z ${VIASH_PAR_OUTPUT_RUN_INFORMATION+x} ]; then echo "${VIASH_PAR_OUTPUT_RUN_INFORMATION}" | sed "s#'#'\\"'\\"'#g;s#.*#par_output_run_information='&'#" ; else echo "# par_output_run_information="; fi ) $( if [ ! -z ${VIASH_META_NAME+x} ]; then echo "${VIASH_META_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_name='&'#" ; else echo "# meta_name="; fi ) $( if [ ! -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then echo "${VIASH_META_FUNCTIONALITY_NAME}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_functionality_name='&'#" ; else echo "# meta_functionality_name="; fi ) $( if [ ! -z ${VIASH_META_RESOURCES_DIR+x} ]; then echo "${VIASH_META_RESOURCES_DIR}" | sed "s#'#'\\"'\\"'#g;s#.*#meta_resources_dir='&'#" ; else echo "# meta_resources_dir="; fi ) @@ -3092,34 +3118,30 @@ $( if [ ! -z ${VIASH_META_MEMORY_PIB+x} ]; then echo "${VIASH_META_MEMORY_PIB}" ## VIASH END #!/bin/bash -echo "Publishing \\$par_input -> \\$par_output" -echo "Publishing \\$par_input_falco -> \\$par_output_falco" -echo "Publishing \\$par_input_multiqc -> \\$par_output_multiqc" +set -eo pipefail -echo -echo "Creating directory if it does not exist:" -mkdir -p \\$(dirname "\\$par_output") && echo "Containing directory \\$par_output created" -mkdir -p \\$(dirname "\\$par_output_falco") && echo "Containing directory \\$par_output_falco created" -mkdir -p \\$(dirname "\\$par_output_multiqc") && echo "Containing directory \\$par_output_multiqc created" +declare -A input_output_mapping=(["par_input"]="par_output" + ["par_input_falco"]="par_output_falco" + ["par_input_multiqc"]="par_output_multiqc" + ["par_input_run_information"]="par_output_run_information" + ) -echo -echo "Copying files..." -cp -rL "\\$par_input" "\\$par_output" -cp -rL "\\$par_input_falco" "\\$par_output_falco" -cp -rL "\\$par_input_multiqc" "\\$par_output_multiqc" +for input_argument_name in "\\${!input_output_mapping[@]}" +do + input_location="\\${!input_argument_name}" + output_argument_name="\\${input_output_mapping[\\$input_argument_name]}" + output_location="\\${!output_argument_name}" + echo "Publishing \\$input_location -> \\$output_location" -echo -echo "Output files:" -echo "par_output:" -ls "\\$par_output" + echo "Creating directory if it does not exist." + mkdir -p \\$(dirname "\\$output_location") && echo "Containing directory \\$output_location created" -echo -echo "par_output_falco:" -ls "\\$par_output_falco" + echo "Copying files..." + cp -rL "\\$input_location" "\\$output_location" -echo -echo "par_output_multiqc:" -ls "\\$par_output_multiqc" + echo "Output files for \\$output_location:" + ls "\\$output_location" +done VIASHMAIN bash "$tempscript" ''' diff --git a/target/nextflow/io/publish/nextflow_schema.json b/target/nextflow/io/publish/nextflow_schema.json index f8924a6..a4f46f3 100644 --- a/target/nextflow/io/publish/nextflow_schema.json +++ b/target/nextflow/io/publish/nextflow_schema.json @@ -37,8 +37,18 @@ "input_multiqc": { "type": "string", - "description": "Type: `file`, required. Directory to write falco output to", - "help_text": "Type: `file`, required. Directory to write falco output to" + "description": "Type: `file`, required. Location where to write the MultiQC report to", + "help_text": "Type: `file`, required. Location where to write the MultiQC report to." + + } + + + , + "input_run_information": { + "type": + "string", + "description": "Type: `file`, required. Location where to write the run information to", + "help_text": "Type: `file`, required. Location where to write the run information to." } @@ -86,6 +96,17 @@ } + , + "output_run_information": { + "type": + "string", + "description": "Type: `file`, default: `$id.$key.output_run_information.csv`. ", + "help_text": "Type: `file`, default: `$id.$key.output_run_information.csv`. " + , + "default":"$id.$key.output_run_information.csv" + } + + } }, diff --git a/target/nextflow/io/untar/.config.vsh.yaml b/target/nextflow/io/untar/.config.vsh.yaml index ccd953d..a17b5ba 100644 --- a/target/nextflow/io/untar/.config.vsh.yaml +++ b/target/nextflow/io/untar/.config.vsh.yaml @@ -148,9 +148,9 @@ build_info: output: "target/nextflow/io/untar" executable: "target/nextflow/io/untar/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" package_config: name: "demultiplex" version: "main" diff --git a/target/nextflow/io/untar/main.nf b/target/nextflow/io/untar/main.nf index 779360d..97d57ae 100644 --- a/target/nextflow/io/untar/main.nf +++ b/target/nextflow/io/untar/main.nf @@ -2989,9 +2989,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/io/untar", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", diff --git a/target/nextflow/runner/.config.vsh.yaml b/target/nextflow/runner/.config.vsh.yaml index 32ba89d..ca44264 100644 --- a/target/nextflow/runner/.config.vsh.yaml +++ b/target/nextflow/runner/.config.vsh.yaml @@ -179,9 +179,9 @@ build_info: output: "target/nextflow/runner" executable: "target/nextflow/runner/main.nf" viash_version: "0.9.0" - git_commit: "8d3c2888d6df6688763d303dba03ce53d339fb0f" - git_remote: "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex" - git_tag: "v0.1.1-12-g8d3c288" + git_commit: "798e361afeea8dbb84dc23ef38e4fbc3883463e7" + git_remote: "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex" + git_tag: "v0.1.1-13-g798e361" dependencies: - "target/nextflow/demultiplex" - "target/nextflow/io/publish" diff --git a/target/nextflow/runner/main.nf b/target/nextflow/runner/main.nf index e7e928b..cab5774 100644 --- a/target/nextflow/runner/main.nf +++ b/target/nextflow/runner/main.nf @@ -3021,9 +3021,9 @@ meta = [ "engine" : "native|native", "output" : "target/nextflow/runner", "viash_version" : "0.9.0", - "git_commit" : "8d3c2888d6df6688763d303dba03ce53d339fb0f", - "git_remote" : "https://x-access-token:ghs_Iv5SuazXszUy4WWFyKOtFABImrj2oY0GsE3i@github.com/viash-hub/demultiplex", - "git_tag" : "v0.1.1-12-g8d3c288" + "git_commit" : "798e361afeea8dbb84dc23ef38e4fbc3883463e7", + "git_remote" : "https://x-access-token:ghs_44flLTQIYGBkc9xcwCZoLYe7mxXzgw1iszFO@github.com/viash-hub/demultiplex", + "git_tag" : "v0.1.1-13-g798e361" }, "package_config" : { "name" : "demultiplex", @@ -3090,14 +3090,20 @@ workflow run_wf { ] } | demultiplex.run( - fromState: [ - "input": "input", - "run_information": "run_information", - "demultiplexer": "demultiplexer", - "output": "fastq", - "output_falco": "qc/fastqc", - "output_multiqc": "qc/multiqc_report.html" - ], + fromState: { id, state -> + def state_to_pass = [ + "input": state.input, + "run_information": state.run_information, + "demultiplexer": state.demultiplexer, + "output": "fastq", + "output_falco": "qc/fastqc", + "output_multiqc": "qc/multiqc_report.html", + ] + if (state.run_information) { + state_to_pass += ["output_run_information": state.run_information.getName()] + } + state_to_pass + }, toState: { id, result, state -> state + result }, @@ -3111,6 +3117,7 @@ workflow run_wf { def fastq_output_1 = (id2 == "run") ? state.fastq_output : "${id2}/" + state.fastq_output def falco_output_1 = (id2 == "run") ? state.falco_output : "${id2}/" + state.falco_output def multiqc_output_1 = (id2 == "run") ? state.multiqc_output : "${id2}/" + state.multiqc_output + def run_information_output_1 = (id2 == "run") ? "${state.output_run_information.getName()}" : "${id2}/${state.output_run_information.getName()}" if (id2 == "run") { println("Publising to ${params.publish_dir}") @@ -3122,9 +3129,11 @@ workflow run_wf { input: state.output, input_falco: state.output_falco, input_multiqc: state.output_multiqc, + input_run_information: state.output_run_information, output: fastq_output_1, output_falco: falco_output_1, - output_multiqc: multiqc_output_1 + output_multiqc: multiqc_output_1, + output_run_information: run_information_output_1, ] }, toState: { id, result, state -> [:] },