diff --git a/README.md b/README.md index aba08b0..afad461 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ nextflow run Sage-Bionetworks-Workflows/nf-artist --input ├── outdir │ ├── │ │ ├── thumbnail.jpeg +│ │ ├── ometiff (optional, if --save_ometiff is true) +│ │ │ ├── .ome.tiff │ │ ├── minerva │ │ │ ├── index.html │ │ │ ├── exhibit.json @@ -56,6 +58,8 @@ nextflow run Sage-Bionetworks-Workflows/nf-artist --input * **outdir**: Specifies the directory where the output data should be saved. Default is "outputs". (Type: String) +* **save_ometiff**: Setting this to true will save converted OME-TIFF files to the output directory in an `ometiff` subdirectory. Default is false. (Type: Boolean) + #### Miniature Options: * **remove_bg**: Setting this to true will remove the non-tissue background. Default is true. (Type: Boolean) diff --git a/main.nf b/main.nf index c938f01..bf6c554 100644 --- a/main.nf +++ b/main.nf @@ -6,6 +6,7 @@ nextflow.enable.dsl=2 if (params.input) { params.input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' } params.outdir = "outputs" +params.save_ometiff = false params.remove_bg = true params.level = -1 params.dimred = "umap" diff --git a/modules/bioformats2ometiff.nf b/modules/bioformats2ometiff.nf index 2615907..4fc13f5 100644 --- a/modules/bioformats2ometiff.nf +++ b/modules/bioformats2ometiff.nf @@ -5,6 +5,10 @@ process bioformats2ometiff { tuple val(meta), file(image) output: tuple val(meta), file("${image.simpleName}.ome.tiff") + publishDir "$params.outdir", + enabled: params.save_ometiff, + pattern: "*.ome.tiff", + saveAs: {filename -> "${meta.id}/ometiff/${filename}"} stub: """ touch raw_dir diff --git a/nextflow_schema.json b/nextflow_schema.json index 641dfe9..0a5b949 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -22,10 +22,15 @@ "type": "string", "description": "Directory in which outputs are placed", "default": "outputs" + }, + "save_ometiff": { + "type": "boolean", + "description": "Save converted OME-TIFF files to output directory", + "default": false } } }, - "miniatue_options": { + "miniature_options": { "title": "Miniature options", "type": "object", "fa_icon": "fas fa-palette", @@ -38,7 +43,7 @@ }, "level": { "type": "integer", - "description": "The pyramid level used in thumbnauls, Default: -1 (smallest)", + "description": "The pyramid level used in thumbnails, Default: -1 (smallest)", "default": -1 }, "dimred": { @@ -49,13 +54,13 @@ }, "colormap": { "type": "string", - "description": "The colormap used. Ensure colormap is compatiable with `n_components` selected ", + "description": "The colormap used. Ensure colormap is compatible with `n_components` selected ", "enum": ["UCIE", "LAB", "RGB", "BREMM", "SCHUMANN", "STEIGER", "TEULING2", "ZIEGLER","CUBEDIAGONAL"], "default": "UCIE" }, "n_components": { "type": "integer", - "description": "", + "description": "Number of components for dimensionality reduction", "default": 3, "enum": [2,3] } @@ -64,7 +69,10 @@ }, "allOf": [ { - "$ref": "#/definitions/parameters" + "$ref": "#/definitions/input_output_options" + }, + { + "$ref": "#/definitions/miniature_options" } ] } \ No newline at end of file