Build branch save-params with version save-params (24e6d49)
Build pipeline: viash-hub.htrnaseq.save-params-tsz2t
Source commit: 24e6d49c09
Source message: PR fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
name: save_params
|
||||
namespace: utils
|
||||
description: |
|
||||
Save parameters to a file
|
||||
Save parameters to a YAML file
|
||||
|
||||
argument_groups:
|
||||
- name: Inputs
|
||||
@@ -13,7 +13,7 @@ argument_groups:
|
||||
required: true
|
||||
- name: "--params_yaml"
|
||||
description: |
|
||||
base64 encoded yaml file containing the state
|
||||
base64 encoded yaml containing the state
|
||||
type: string
|
||||
required: true
|
||||
|
||||
@@ -21,9 +21,10 @@ argument_groups:
|
||||
arguments:
|
||||
- name: "--output"
|
||||
description: |
|
||||
The output file
|
||||
The output YAML file
|
||||
type: string
|
||||
required: true
|
||||
example: "output.yaml"
|
||||
|
||||
resources:
|
||||
- type: python_script
|
||||
|
||||
@@ -15,39 +15,24 @@ class Dumper(yaml.Dumper):
|
||||
return super(Dumper, self).increase_indent(flow, False)
|
||||
|
||||
def decode_params_yaml(encoded_yaml):
|
||||
# Step 1: Decode from Base64
|
||||
yaml_bytes = base64.b64decode(encoded_yaml)
|
||||
|
||||
# Step 2: Convert bytes to string
|
||||
yaml_string = yaml_bytes.decode('utf-8')
|
||||
|
||||
# Step 3: Extract pattern for Java path objects
|
||||
# Find pattern: !!sun.nio.fs.UnixPath /path/to/file
|
||||
pattern = r'!!sun\.nio\.fs\.UnixPath\s+([^\n]+)'
|
||||
|
||||
# Replace with the actual path string (captured group)
|
||||
yaml_string = re.sub(pattern, r'\1', yaml_string)
|
||||
|
||||
# Handle any remaining empty UnixPath objects
|
||||
yaml_string = yaml_string.replace('!!sun.nio.fs.UnixPath {}', '""')
|
||||
|
||||
# Step 4: Parse YAML
|
||||
yaml_data = yaml.safe_load(yaml_string)
|
||||
|
||||
return yaml_data
|
||||
|
||||
def replace_id(value, sample_id):
|
||||
if isinstance(value, str):
|
||||
return value.replace('$id', sample_id)
|
||||
elif isinstance(value, list):
|
||||
return [replace_id(item, sample_id) for item in value]
|
||||
return value
|
||||
# def replace_id(value, sample_id):
|
||||
# if isinstance(value, str):
|
||||
# return value.replace('$id', sample_id)
|
||||
# elif isinstance(value, list):
|
||||
# return [replace_id(item, sample_id) for item in value]
|
||||
# return value
|
||||
|
||||
print(par['params_yaml'])
|
||||
|
||||
params = decode_params_yaml(par['params_yaml'])
|
||||
for key, value in params.items():
|
||||
params[key] = replace_id(value, par["id"])
|
||||
# for key, value in params.items():
|
||||
# params[key] = replace_id(value, par["id"])
|
||||
|
||||
with open(par["output"], 'w') as f:
|
||||
yaml.dump(params, f, default_flow_style=False, Dumper=Dumper)
|
||||
|
||||
@@ -88,6 +88,11 @@ argument_groups:
|
||||
direction: output
|
||||
required: true
|
||||
default: report.$id.html
|
||||
- name: "--params"
|
||||
type: file
|
||||
direction: output
|
||||
required: true
|
||||
default: params.$id.yaml
|
||||
resources:
|
||||
- type: nextflow_script
|
||||
path: main.nf
|
||||
|
||||
@@ -11,14 +11,6 @@ workflow run_wf {
|
||||
return [id, newState]
|
||||
}
|
||||
|
||||
// The featureData only has one requirement: the genome annotation.
|
||||
// It can be generated straight away. Most of the time, there is one shared
|
||||
// annotation for all of the inputs and the fData should only be calculated once.
|
||||
// The state is manpulated in such a way that there is one event created per unique
|
||||
// input annotation file. In turn, the featureData file can joined into the original input
|
||||
// channel which allows it to be shared across events if required.
|
||||
f_data_ch = input_ch
|
||||
|
||||
| save_params.run(
|
||||
fromState: {id, state ->
|
||||
// Define the function before using it
|
||||
@@ -26,8 +18,10 @@ workflow run_wf {
|
||||
convertPaths = { value ->
|
||||
if (value instanceof java.nio.file.Path)
|
||||
return value.toUriString()
|
||||
else if (value instanceof Collection)
|
||||
else if (value instanceof List)
|
||||
return value.collect { convertPaths(it) }
|
||||
else if (value instanceof Collection)
|
||||
throw new UnsupportedOperationException("Collections other than Lists are not supported")
|
||||
else
|
||||
return value
|
||||
}
|
||||
@@ -42,12 +36,21 @@ workflow run_wf {
|
||||
return [
|
||||
"id": id,
|
||||
"params_yaml": encodedYaml,
|
||||
"output": "${id}_parameters.yaml"
|
||||
"output": "params"
|
||||
]
|
||||
},
|
||||
toState: ["parameters": "output"]
|
||||
toState: ["params": "output"]
|
||||
)
|
||||
|
||||
// The featureData only has one requirement: the genome annotation.
|
||||
// It can be generated straight away. Most of the time, there is one shared
|
||||
// annotation for all of the inputs and the fData should only be calculated once.
|
||||
// The state is manpulated in such a way that there is one event created per unique
|
||||
// input annotation file. In turn, the featureData file can joined into the original input
|
||||
// channel which allows it to be shared across events if required.
|
||||
f_data_ch = input_ch
|
||||
|
||||
|
||||
| toSortedList()
|
||||
| flatMap {ids_and_states ->
|
||||
def annotation_files = ids_and_states.inject([:]){ old_state, id_and_state ->
|
||||
@@ -347,7 +350,7 @@ workflow run_wf {
|
||||
"f_data": "f_data",
|
||||
"p_data": "p_data",
|
||||
"html_report": "html_report",
|
||||
"parameters": "parameters",
|
||||
"params": "params",
|
||||
"_meta": "_meta",
|
||||
])
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ build_info:
|
||||
output: "target/executable/eset/create_eset"
|
||||
executable: "target/executable/eset/create_eset/create_eset"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -456,9 +456,9 @@ RUN Rscript -e 'options(warn = 2); if (!requireNamespace("remotes", quietly = TR
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Marijke Van Moerbeke"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component eset create_eset"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:02Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:25Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -180,7 +180,7 @@ build_info:
|
||||
output: "target/executable/eset/create_fdata"
|
||||
executable: "target/executable/eset/create_fdata/create_fdata"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -458,9 +458,9 @@ RUN pip install --upgrade pip && \
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Marijke Van Moerbeke"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component eset create_fdata"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:02Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:25Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -194,7 +194,7 @@ build_info:
|
||||
output: "target/executable/eset/create_pdata"
|
||||
executable: "target/executable/eset/create_pdata/create_pdata"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -458,9 +458,9 @@ RUN pip install --upgrade pip && \
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Marijke Van Moerbeke"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component eset create_pdata"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:03Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:25Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -152,7 +152,7 @@ build_info:
|
||||
output: "target/executable/integration_test_components/htrnaseq/check_eset"
|
||||
executable: "target/executable/integration_test_components/htrnaseq/check_eset/check_eset"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -455,9 +455,9 @@ RUN Rscript -e 'options(warn = 2); if (!requireNamespace("remotes", quietly = TR
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component integration_test_components/htrnaseq check_eset"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:01Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:24Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -161,7 +161,7 @@ build_info:
|
||||
output: "target/executable/integration_test_components/well_demultiplexing/check_cutadapt_output"
|
||||
executable: "target/executable/integration_test_components/well_demultiplexing/check_cutadapt_output/check_cutadapt_output"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -457,9 +457,9 @@ RUN pip install --upgrade pip && \
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component integration_test_components/well_demultiplexing check_cutadapt_output"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:03Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:26Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -136,7 +136,7 @@ build_info:
|
||||
output: "target/executable/io/publish_fastqs"
|
||||
executable: "target/executable/io/publish_fastqs/publish_fastqs"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -450,9 +450,9 @@ RUN apt-get update && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
LABEL org.opencontainers.image.description="Companion container for running component io publish_fastqs"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:01Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:24Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -190,7 +190,7 @@ build_info:
|
||||
output: "target/executable/io/publish_results"
|
||||
executable: "target/executable/io/publish_results/publish_results"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -450,9 +450,9 @@ RUN apt-get update && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
LABEL org.opencontainers.image.description="Companion container for running component io publish_results"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:02Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:24Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -282,7 +282,7 @@ build_info:
|
||||
output: "target/executable/parallel_map"
|
||||
executable: "target/executable/parallel_map/parallel_map"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -461,9 +461,9 @@ ENV STAR_BINARY=STAR
|
||||
COPY STAR /usr/local/bin/$STAR_BINARY
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Toni Verbeiren"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component parallel_map"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:03Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:26Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -206,7 +206,7 @@ build_info:
|
||||
output: "target/executable/report/create_report"
|
||||
executable: "target/executable/report/create_report/create_report"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -462,9 +462,9 @@ RUN Rscript -e 'options(warn = 2); if (!requireNamespace("remotes", quietly = TR
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Marijke Van Moerbeke"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component report create_report"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:03Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:25Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -201,7 +201,7 @@ build_info:
|
||||
output: "target/executable/stats/combine_star_logs"
|
||||
executable: "target/executable/stats/combine_star_logs/combine_star_logs"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -457,9 +457,9 @@ RUN pip install --upgrade pip && \
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component stats combine_star_logs"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:01Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:24Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -185,7 +185,7 @@ build_info:
|
||||
output: "target/executable/stats/generate_pool_statistics"
|
||||
executable: "target/executable/stats/generate_pool_statistics/generate_pool_statistics"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -458,9 +458,9 @@ RUN pip install --upgrade pip && \
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Marijke Van Moerbeke"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component stats generate_pool_statistics"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:02Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:24Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -267,7 +267,7 @@ build_info:
|
||||
output: "target/executable/stats/generate_well_statistics"
|
||||
executable: "target/executable/stats/generate_well_statistics/generate_well_statistics"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -461,9 +461,9 @@ RUN pip install --upgrade pip && \
|
||||
|
||||
LABEL org.opencontainers.image.authors="Dries Schaumont, Marijke Van Moerbeke"
|
||||
LABEL org.opencontainers.image.description="Companion container for running component stats generate_well_statistics"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:01Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:24Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
|
||||
@@ -14,7 +14,7 @@ argument_groups:
|
||||
multiple_sep: ";"
|
||||
- type: "string"
|
||||
name: "--params_yaml"
|
||||
description: "base64 encoded yaml file containing the state\n"
|
||||
description: "base64 encoded yaml containing the state\n"
|
||||
info: null
|
||||
required: true
|
||||
direction: "input"
|
||||
@@ -24,8 +24,10 @@ argument_groups:
|
||||
arguments:
|
||||
- type: "string"
|
||||
name: "--output"
|
||||
description: "The output file\n"
|
||||
description: "The output YAML file\n"
|
||||
info: null
|
||||
example:
|
||||
- "output.yaml"
|
||||
required: true
|
||||
direction: "input"
|
||||
multiple: false
|
||||
@@ -37,7 +39,7 @@ resources:
|
||||
- type: "file"
|
||||
path: "nextflow_labels.config"
|
||||
dest: "nextflow_labels.config"
|
||||
description: "Save parameters to a file\n"
|
||||
description: "Save parameters to a YAML file\n"
|
||||
info: null
|
||||
status: "enabled"
|
||||
scope:
|
||||
@@ -144,7 +146,7 @@ build_info:
|
||||
output: "target/executable/utils/save_params"
|
||||
executable: "target/executable/utils/save_params/save_params"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -453,9 +453,9 @@ RUN pip install --upgrade pip && \
|
||||
pip install --upgrade --no-cache-dir "pyyaml"
|
||||
|
||||
LABEL org.opencontainers.image.description="Companion container for running component utils save_params"
|
||||
LABEL org.opencontainers.image.created="2025-04-01T15:16:03Z"
|
||||
LABEL org.opencontainers.image.created="2025-04-03T13:19:26Z"
|
||||
LABEL org.opencontainers.image.source="https://github.com/viash-hub/htrnaseq"
|
||||
LABEL org.opencontainers.image.revision="05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
LABEL org.opencontainers.image.revision="24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
LABEL org.opencontainers.image.version="save-params"
|
||||
|
||||
VIASHDOCKER
|
||||
@@ -575,7 +575,7 @@ VIASH_DOCKER_RUN_ARGS=(-i --rm)
|
||||
function ViashHelp {
|
||||
echo "save_params save-params"
|
||||
echo ""
|
||||
echo "Save parameters to a file"
|
||||
echo "Save parameters to a YAML file"
|
||||
echo ""
|
||||
echo "Inputs:"
|
||||
echo " --id"
|
||||
@@ -584,12 +584,13 @@ function ViashHelp {
|
||||
echo ""
|
||||
echo " --params_yaml"
|
||||
echo " type: string, required parameter"
|
||||
echo " base64 encoded yaml file containing the state"
|
||||
echo " base64 encoded yaml containing the state"
|
||||
echo ""
|
||||
echo "Outputs:"
|
||||
echo " --output"
|
||||
echo " type: string, required parameter"
|
||||
echo " The output file"
|
||||
echo " example: output.yaml"
|
||||
echo " The output YAML file"
|
||||
echo ""
|
||||
echo "Viash built in Computational Requirements:"
|
||||
echo " ---cpus=INT"
|
||||
@@ -1078,39 +1079,24 @@ class Dumper(yaml.Dumper):
|
||||
return super(Dumper, self).increase_indent(flow, False)
|
||||
|
||||
def decode_params_yaml(encoded_yaml):
|
||||
# Step 1: Decode from Base64
|
||||
yaml_bytes = base64.b64decode(encoded_yaml)
|
||||
|
||||
# Step 2: Convert bytes to string
|
||||
yaml_string = yaml_bytes.decode('utf-8')
|
||||
|
||||
# Step 3: Extract pattern for Java path objects
|
||||
# Find pattern: !!sun.nio.fs.UnixPath /path/to/file
|
||||
pattern = r'!!sun\\.nio\\.fs\\.UnixPath\\s+([^\\n]+)'
|
||||
|
||||
# Replace with the actual path string (captured group)
|
||||
yaml_string = re.sub(pattern, r'\\1', yaml_string)
|
||||
|
||||
# Handle any remaining empty UnixPath objects
|
||||
yaml_string = yaml_string.replace('!!sun.nio.fs.UnixPath {}', '""')
|
||||
|
||||
# Step 4: Parse YAML
|
||||
yaml_data = yaml.safe_load(yaml_string)
|
||||
|
||||
return yaml_data
|
||||
|
||||
def replace_id(value, sample_id):
|
||||
if isinstance(value, str):
|
||||
return value.replace('\$id', sample_id)
|
||||
elif isinstance(value, list):
|
||||
return [replace_id(item, sample_id) for item in value]
|
||||
return value
|
||||
# def replace_id(value, sample_id):
|
||||
# if isinstance(value, str):
|
||||
# return value.replace('\$id', sample_id)
|
||||
# elif isinstance(value, list):
|
||||
# return [replace_id(item, sample_id) for item in value]
|
||||
# return value
|
||||
|
||||
print(par['params_yaml'])
|
||||
|
||||
params = decode_params_yaml(par['params_yaml'])
|
||||
for key, value in params.items():
|
||||
params[key] = replace_id(value, par["id"])
|
||||
# for key, value in params.items():
|
||||
# params[key] = replace_id(value, par["id"])
|
||||
|
||||
with open(par["output"], 'w') as f:
|
||||
yaml.dump(params, f, default_flow_style=False, Dumper=Dumper)
|
||||
|
||||
@@ -203,7 +203,7 @@ build_info:
|
||||
output: "target/nextflow/eset/create_eset"
|
||||
executable: "target/nextflow/eset/create_eset/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3309,7 +3309,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/eset/create_eset",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -180,7 +180,7 @@ build_info:
|
||||
output: "target/nextflow/eset/create_fdata"
|
||||
executable: "target/nextflow/eset/create_fdata/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3279,7 +3279,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/eset/create_fdata",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -194,7 +194,7 @@ build_info:
|
||||
output: "target/nextflow/eset/create_pdata"
|
||||
executable: "target/nextflow/eset/create_pdata/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3293,7 +3293,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/eset/create_pdata",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -152,7 +152,7 @@ build_info:
|
||||
output: "target/nextflow/integration_test_components/htrnaseq/check_eset"
|
||||
executable: "target/nextflow/integration_test_components/htrnaseq/check_eset/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3233,7 +3233,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/integration_test_components/htrnaseq/check_eset",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -161,7 +161,7 @@ build_info:
|
||||
output: "target/nextflow/integration_test_components/well_demultiplexing/check_cutadapt_output"
|
||||
executable: "target/nextflow/integration_test_components/well_demultiplexing/check_cutadapt_output/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3244,7 +3244,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/integration_test_components/well_demultiplexing/check_cutadapt_output",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -136,7 +136,7 @@ build_info:
|
||||
output: "target/nextflow/io/publish_fastqs"
|
||||
executable: "target/nextflow/io/publish_fastqs/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3207,7 +3207,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/io/publish_fastqs",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -190,7 +190,7 @@ build_info:
|
||||
output: "target/nextflow/io/publish_results"
|
||||
executable: "target/nextflow/io/publish_results/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3267,7 +3267,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/io/publish_results",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -282,7 +282,7 @@ build_info:
|
||||
output: "target/nextflow/parallel_map"
|
||||
executable: "target/nextflow/parallel_map/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3379,7 +3379,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/parallel_map",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -206,7 +206,7 @@ build_info:
|
||||
output: "target/nextflow/report/create_report"
|
||||
executable: "target/nextflow/report/create_report/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3314,7 +3314,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/report/create_report",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -201,7 +201,7 @@ build_info:
|
||||
output: "target/nextflow/stats/combine_star_logs"
|
||||
executable: "target/nextflow/stats/combine_star_logs/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3295,7 +3295,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/stats/combine_star_logs",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -185,7 +185,7 @@ build_info:
|
||||
output: "target/nextflow/stats/generate_pool_statistics"
|
||||
executable: "target/nextflow/stats/generate_pool_statistics/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3279,7 +3279,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/stats/generate_pool_statistics",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -267,7 +267,7 @@ build_info:
|
||||
output: "target/nextflow/stats/generate_well_statistics"
|
||||
executable: "target/nextflow/stats/generate_well_statistics/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3374,7 +3374,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/stats/generate_well_statistics",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -157,7 +157,7 @@ build_info:
|
||||
output: "target/nextflow/utils/concatRuns"
|
||||
executable: "target/nextflow/utils/concatRuns/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
dependencies:
|
||||
- "target/dependencies/vsh/vsh/craftbox/v0.1.0/nextflow/concat_text"
|
||||
|
||||
@@ -3229,7 +3229,7 @@ meta = [
|
||||
"engine" : "native|native",
|
||||
"output" : "target/nextflow/utils/concatRuns",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -168,7 +168,7 @@ build_info:
|
||||
output: "target/nextflow/utils/listInputDir"
|
||||
executable: "target/nextflow/utils/listInputDir/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3239,7 +3239,7 @@ meta = [
|
||||
"engine" : "native|native",
|
||||
"output" : "target/nextflow/utils/listInputDir",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -14,7 +14,7 @@ argument_groups:
|
||||
multiple_sep: ";"
|
||||
- type: "string"
|
||||
name: "--params_yaml"
|
||||
description: "base64 encoded yaml file containing the state\n"
|
||||
description: "base64 encoded yaml containing the state\n"
|
||||
info: null
|
||||
required: true
|
||||
direction: "input"
|
||||
@@ -24,8 +24,10 @@ argument_groups:
|
||||
arguments:
|
||||
- type: "string"
|
||||
name: "--output"
|
||||
description: "The output file\n"
|
||||
description: "The output YAML file\n"
|
||||
info: null
|
||||
example:
|
||||
- "output.yaml"
|
||||
required: true
|
||||
direction: "input"
|
||||
multiple: false
|
||||
@@ -37,7 +39,7 @@ resources:
|
||||
- type: "file"
|
||||
path: "nextflow_labels.config"
|
||||
dest: "nextflow_labels.config"
|
||||
description: "Save parameters to a file\n"
|
||||
description: "Save parameters to a YAML file\n"
|
||||
info: null
|
||||
status: "enabled"
|
||||
scope:
|
||||
@@ -144,7 +146,7 @@ build_info:
|
||||
output: "target/nextflow/utils/save_params"
|
||||
executable: "target/nextflow/utils/save_params/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3054,7 +3054,7 @@ meta = [
|
||||
{
|
||||
"type" : "string",
|
||||
"name" : "--params_yaml",
|
||||
"description" : "base64 encoded yaml file containing the state\n",
|
||||
"description" : "base64 encoded yaml containing the state\n",
|
||||
"required" : true,
|
||||
"direction" : "input",
|
||||
"multiple" : false,
|
||||
@@ -3068,7 +3068,10 @@ meta = [
|
||||
{
|
||||
"type" : "string",
|
||||
"name" : "--output",
|
||||
"description" : "The output file\n",
|
||||
"description" : "The output YAML file\n",
|
||||
"example" : [
|
||||
"output.yaml"
|
||||
],
|
||||
"required" : true,
|
||||
"direction" : "input",
|
||||
"multiple" : false,
|
||||
@@ -3089,7 +3092,7 @@ meta = [
|
||||
"dest" : "nextflow_labels.config"
|
||||
}
|
||||
],
|
||||
"description" : "Save parameters to a file\n",
|
||||
"description" : "Save parameters to a YAML file\n",
|
||||
"status" : "enabled",
|
||||
"scope" : {
|
||||
"image" : "public",
|
||||
@@ -3218,7 +3221,7 @@ meta = [
|
||||
"engine" : "docker|native",
|
||||
"output" : "target/nextflow/utils/save_params",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
@@ -3311,39 +3314,24 @@ class Dumper(yaml.Dumper):
|
||||
return super(Dumper, self).increase_indent(flow, False)
|
||||
|
||||
def decode_params_yaml(encoded_yaml):
|
||||
# Step 1: Decode from Base64
|
||||
yaml_bytes = base64.b64decode(encoded_yaml)
|
||||
|
||||
# Step 2: Convert bytes to string
|
||||
yaml_string = yaml_bytes.decode('utf-8')
|
||||
|
||||
# Step 3: Extract pattern for Java path objects
|
||||
# Find pattern: !!sun.nio.fs.UnixPath /path/to/file
|
||||
pattern = r'!!sun\\\\.nio\\\\.fs\\\\.UnixPath\\\\s+([^\\\\n]+)'
|
||||
|
||||
# Replace with the actual path string (captured group)
|
||||
yaml_string = re.sub(pattern, r'\\\\1', yaml_string)
|
||||
|
||||
# Handle any remaining empty UnixPath objects
|
||||
yaml_string = yaml_string.replace('!!sun.nio.fs.UnixPath {}', '""')
|
||||
|
||||
# Step 4: Parse YAML
|
||||
yaml_data = yaml.safe_load(yaml_string)
|
||||
|
||||
return yaml_data
|
||||
|
||||
def replace_id(value, sample_id):
|
||||
if isinstance(value, str):
|
||||
return value.replace('\\$id', sample_id)
|
||||
elif isinstance(value, list):
|
||||
return [replace_id(item, sample_id) for item in value]
|
||||
return value
|
||||
# def replace_id(value, sample_id):
|
||||
# if isinstance(value, str):
|
||||
# return value.replace('\\$id', sample_id)
|
||||
# elif isinstance(value, list):
|
||||
# return [replace_id(item, sample_id) for item in value]
|
||||
# return value
|
||||
|
||||
print(par['params_yaml'])
|
||||
|
||||
params = decode_params_yaml(par['params_yaml'])
|
||||
for key, value in params.items():
|
||||
params[key] = replace_id(value, par["id"])
|
||||
# for key, value in params.items():
|
||||
# params[key] = replace_id(value, par["id"])
|
||||
|
||||
with open(par["output"], 'w') as f:
|
||||
yaml.dump(params, f, default_flow_style=False, Dumper=Dumper)
|
||||
|
||||
@@ -3,7 +3,7 @@ manifest {
|
||||
mainScript = 'main.nf'
|
||||
nextflowVersion = '!>=20.12.1-edge'
|
||||
version = 'save-params'
|
||||
description = 'Save parameters to a file\n'
|
||||
description = 'Save parameters to a YAML file\n'
|
||||
}
|
||||
|
||||
process.container = 'nextflow/bash:latest'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"title": "save_params",
|
||||
"description": "Save parameters to a file\n",
|
||||
"description": "Save parameters to a YAML file\n",
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"params_yaml": {
|
||||
"type":
|
||||
"string",
|
||||
"description": "Type: `string`, required. base64 encoded yaml file containing the state\n",
|
||||
"help_text": "Type: `string`, required. base64 encoded yaml file containing the state\n"
|
||||
"description": "Type: `string`, required. base64 encoded yaml containing the state\n",
|
||||
"help_text": "Type: `string`, required. base64 encoded yaml containing the state\n"
|
||||
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
"output": {
|
||||
"type":
|
||||
"string",
|
||||
"description": "Type: `string`, required. The output file\n",
|
||||
"help_text": "Type: `string`, required. The output file\n"
|
||||
"description": "Type: `string`, required, example: `output.yaml`. The output YAML file\n",
|
||||
"help_text": "Type: `string`, required, example: `output.yaml`. The output YAML file\n"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -183,6 +183,17 @@ argument_groups:
|
||||
direction: "output"
|
||||
multiple: false
|
||||
multiple_sep: ";"
|
||||
- type: "file"
|
||||
name: "--params"
|
||||
info: null
|
||||
default:
|
||||
- "params.$id.yaml"
|
||||
must_exist: true
|
||||
create_parent: true
|
||||
required: true
|
||||
direction: "output"
|
||||
multiple: false
|
||||
multiple_sep: ";"
|
||||
resources:
|
||||
- type: "nextflow_script"
|
||||
path: "main.nf"
|
||||
@@ -331,7 +342,7 @@ build_info:
|
||||
output: "target/nextflow/workflows/htrnaseq"
|
||||
executable: "target/nextflow/workflows/htrnaseq/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
dependencies:
|
||||
- "target/nextflow/stats/combine_star_logs"
|
||||
|
||||
@@ -3252,6 +3252,19 @@ meta = [
|
||||
"direction" : "output",
|
||||
"multiple" : false,
|
||||
"multiple_sep" : ";"
|
||||
},
|
||||
{
|
||||
"type" : "file",
|
||||
"name" : "--params",
|
||||
"default" : [
|
||||
"params.$id.yaml"
|
||||
],
|
||||
"must_exist" : true,
|
||||
"create_parent" : true,
|
||||
"required" : true,
|
||||
"direction" : "output",
|
||||
"multiple" : false,
|
||||
"multiple_sep" : ";"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3471,7 +3484,7 @@ meta = [
|
||||
"engine" : "native|native",
|
||||
"output" : "target/nextflow/workflows/htrnaseq",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
@@ -3543,14 +3556,6 @@ workflow run_wf {
|
||||
return [id, newState]
|
||||
}
|
||||
|
||||
// The featureData only has one requirement: the genome annotation.
|
||||
// It can be generated straight away. Most of the time, there is one shared
|
||||
// annotation for all of the inputs and the fData should only be calculated once.
|
||||
// The state is manpulated in such a way that there is one event created per unique
|
||||
// input annotation file. In turn, the featureData file can joined into the original input
|
||||
// channel which allows it to be shared across events if required.
|
||||
f_data_ch = input_ch
|
||||
|
||||
| save_params.run(
|
||||
fromState: {id, state ->
|
||||
// Define the function before using it
|
||||
@@ -3558,8 +3563,10 @@ workflow run_wf {
|
||||
convertPaths = { value ->
|
||||
if (value instanceof java.nio.file.Path)
|
||||
return value.toUriString()
|
||||
else if (value instanceof Collection)
|
||||
else if (value instanceof List)
|
||||
return value.collect { convertPaths(it) }
|
||||
else if (value instanceof Collection)
|
||||
throw new UnsupportedOperationException("Collections other than Lists are not supported")
|
||||
else
|
||||
return value
|
||||
}
|
||||
@@ -3574,12 +3581,21 @@ workflow run_wf {
|
||||
return [
|
||||
"id": id,
|
||||
"params_yaml": encodedYaml,
|
||||
"output": "${id}_parameters.yaml"
|
||||
"output": "params"
|
||||
]
|
||||
},
|
||||
toState: ["parameters": "output"]
|
||||
toState: ["params": "output"]
|
||||
)
|
||||
|
||||
// The featureData only has one requirement: the genome annotation.
|
||||
// It can be generated straight away. Most of the time, there is one shared
|
||||
// annotation for all of the inputs and the fData should only be calculated once.
|
||||
// The state is manpulated in such a way that there is one event created per unique
|
||||
// input annotation file. In turn, the featureData file can joined into the original input
|
||||
// channel which allows it to be shared across events if required.
|
||||
f_data_ch = input_ch
|
||||
|
||||
|
||||
| toSortedList()
|
||||
| flatMap {ids_and_states ->
|
||||
def annotation_files = ids_and_states.inject([:]){ old_state, id_and_state ->
|
||||
@@ -3879,7 +3895,7 @@ workflow run_wf {
|
||||
"f_data": "f_data",
|
||||
"p_data": "p_data",
|
||||
"html_report": "html_report",
|
||||
"parameters": "parameters",
|
||||
"params": "params",
|
||||
"_meta": "_meta",
|
||||
])
|
||||
|
||||
|
||||
@@ -182,6 +182,17 @@
|
||||
}
|
||||
|
||||
|
||||
,
|
||||
"params": {
|
||||
"type":
|
||||
"string",
|
||||
"description": "Type: `file`, required, default: `$id.$key.params.yaml`. ",
|
||||
"help_text": "Type: `file`, required, default: `$id.$key.params.yaml`. "
|
||||
,
|
||||
"default":"$id.$key.params.yaml"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ build_info:
|
||||
output: "target/nextflow/workflows/runner"
|
||||
executable: "target/nextflow/workflows/runner/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
dependencies:
|
||||
- "target/nextflow/utils/listInputDir"
|
||||
|
||||
@@ -3317,7 +3317,7 @@ meta = [
|
||||
"engine" : "native|native",
|
||||
"output" : "target/nextflow/workflows/runner",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -214,7 +214,7 @@ build_info:
|
||||
output: "target/nextflow/workflows/well_demultiplex"
|
||||
executable: "target/nextflow/workflows/well_demultiplex/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
dependencies:
|
||||
- "target/dependencies/vsh/vsh/biobox/v0.3.0/nextflow/cutadapt"
|
||||
|
||||
@@ -3319,7 +3319,7 @@ meta = [
|
||||
"engine" : "native|native",
|
||||
"output" : "target/nextflow/workflows/well_demultiplex",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
@@ -212,7 +212,7 @@ build_info:
|
||||
output: "target/nextflow/workflows/well_metadata"
|
||||
executable: "target/nextflow/workflows/well_metadata/main.nf"
|
||||
viash_version: "0.9.2"
|
||||
git_commit: "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a"
|
||||
git_commit: "24e6d49c099294ef0cedbe2666fdf64e21aad0df"
|
||||
git_remote: "https://github.com/viash-hub/htrnaseq"
|
||||
package_config:
|
||||
name: "htrnaseq"
|
||||
|
||||
@@ -3299,7 +3299,7 @@ meta = [
|
||||
"engine" : "native|native",
|
||||
"output" : "target/nextflow/workflows/well_metadata",
|
||||
"viash_version" : "0.9.2",
|
||||
"git_commit" : "05ac6a3d2432d2da9a410388f33c45a78fd0cb1a",
|
||||
"git_commit" : "24e6d49c099294ef0cedbe2666fdf64e21aad0df",
|
||||
"git_remote" : "https://github.com/viash-hub/htrnaseq"
|
||||
},
|
||||
"package_config" : {
|
||||
|
||||
Reference in New Issue
Block a user