diff --git a/.nf-core.yml b/.nf-core.yml index 1ebce273..432c27a5 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -11,8 +11,8 @@ lint: nf_core_version: 3.3.2 repository_type: pipeline template: - author: Florian Heyl - description: A pipeline for spatialomics Xenium data. + author: Sameesh Kher, Florian Heyl + description: A pipeline for spatialomics Xenium In Situ data. force: false is_nfcore: true name: spatialxe diff --git a/README.md b/README.md index 13a5ff83..f52f40ce 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,6 @@ ![nf-core/spatialxe-metromap](docs/images/spatialxe-metromap.png) - - ## Usage On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/spatialxe/results). @@ -44,8 +41,6 @@ test_sample,/path/to/xenium-bundle,/path/to/morphology.ome.tif Now, you can run the pipeline using: - - ## Run image-based segmentation mode
`CELLPOSE -> BAYSOR -> XR-IMPORT_SEGMENTATION -> SPATIALDATA -> QC` @@ -55,7 +50,7 @@ nextflow run nf-core/spatialxe \ -profile \ --input samplesheet.csv \ --outdir \ - --mode image + --mode ``` ## Run coordinate-based segmentation mode
diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index aa92fdf6..503f3c54 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -13,3 +13,26 @@ report_section_order: export_plots: true disable_version_detection: true + +run_module: + - xenium + +module_order: + - xenium + +log_filesize_limit: 5000000000 # 5GB + +sp: + cell_feature_matrix: + fn: cell_feature_matrix.h5 + cells: + fn: cells.parquet + experiment: + fn: experiment.xenium + num_lines: 50 + metrics: + contents: num_cells_detected + fn: metrics_summary.csv + num_lines: 5 + transcripts: + fn: transcripts.parquet diff --git a/conf/modules.config b/conf/modules.config index d9228b4f..232e504b 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -81,8 +81,6 @@ process { path: { "${params.outdir}/segger/create_dataset" }, mode: params.publish_dir_mode, ] - tile_width = "120" - tile_height = "120" } withName: SEGGER_TRAIN { @@ -90,9 +88,6 @@ process { path: { "${params.outdir}/segger/train" }, mode: params.publish_dir_mode, ] - batch_size = 4 // larger batch size can speed up training, but requires more memory - devices = 4 // Use multiple GPUs by increasing the devices parameter to further accelerate training - max_epochs = 200 // increasing #epochs can improve model performance with more learning cycles, but extends training time ext.args = { "--init_emb 8 --hidden_channels 32 --num_tx_tokens 500 --out_channels 8 --heads 2 --num_mid_layers 2 --strategy auto --precision 16-mixed" } } @@ -101,8 +96,6 @@ process { path: { "${params.outdir}/segger/predict" }, mode: params.publish_dir_mode, ] - batch_size = 1 // larger batch size can speed up training, but requires more memory - cc_analysis = "false" // to control connected component analysis } withName: PARQUET_TO_CSV { diff --git a/modules.json b/modules.json index 2617b954..879d22a8 100644 --- a/modules.json +++ b/modules.json @@ -7,7 +7,7 @@ "nf-core": { "cellpose": { "branch": "master", - "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", "installed_by": ["modules"], "patch": "modules/nf-core/cellpose/cellpose.diff" }, @@ -18,13 +18,13 @@ }, "untar": { "branch": "master", - "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", "installed_by": ["modules"], "patch": "modules/nf-core/untar/untar.diff" }, "unzip": { "branch": "master", - "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", + "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", "installed_by": ["modules"] }, "xeniumranger/import-segmentation": { @@ -61,7 +61,7 @@ }, "utils_nfschema_plugin": { "branch": "master", - "git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e", + "git_sha": "dcd088f483cede0c3df4034d405126f05a764cc7", "installed_by": ["subworkflows"] } } diff --git a/modules/local/segger/create_dataset/main.nf b/modules/local/segger/create_dataset/main.nf index 7d2ffc12..c2d5c3a6 100644 --- a/modules/local/segger/create_dataset/main.nf +++ b/modules/local/segger/create_dataset/main.nf @@ -33,9 +33,9 @@ process SEGGER_CREATE_DATASET { --base_dir ${base_dir} \\ --data_dir ${prefix} \\ --sample_type ${params.format} \\ + --tile_width ${params.tile_width} \\ + --tile_height ${params.tile_height} \\ --n_workers ${task.cpus} \\ - --tile_width ${task.tile_width} \\ - --tile_height ${task.tile_height} \\ ${args} cat <<-END_VERSIONS > versions.yml diff --git a/modules/local/segger/predict/main.nf b/modules/local/segger/predict/main.nf index 97698016..ca5c0e2f 100644 --- a/modules/local/segger/predict/main.nf +++ b/modules/local/segger/predict/main.nf @@ -11,9 +11,9 @@ process SEGGER_PREDICT { output: - tuple val(meta), path("${meta.id}_benchmarks_dir") , emit: benchmarks - tuple val(meta), path("${meta.id}_benchmarks_dir/*/segger_transcripts.parquet") , emit: transcripts - path("versions.yml") , emit: versions + tuple val(meta), path("${meta.id}_benchmarks_dir") , emit: benchmarks + tuple val(meta), path("${meta.id}_benchmarks_dir/*/segger_transcripts.parquet"), emit: transcripts + path("versions.yml") , emit: versions when: task.ext.when == null || task.ext.when @@ -33,10 +33,10 @@ process SEGGER_PREDICT { --segger_data_dir ${segger_dataset} \\ --transcripts_file ${transcripts} \\ --benchmarks_dir ${prefix}_benchmarks_dir \\ - --num_workers ${task.cpus} \\ - --batch_size ${task.batch_size} \\ - --use_cc ${task.cc_analysis} \\ + --batch_size ${params.batch_size_predict} \\ + --use_cc ${params.cc_analysis} \\ --knn_method ${params.segger_knn_method} \\ + --num_workers ${task.cpus} \\ ${args} cat <<-END_VERSIONS > versions.yml diff --git a/modules/local/segger/train/main.nf b/modules/local/segger/train/main.nf index ec67275b..18d4dc0d 100644 --- a/modules/local/segger/train/main.nf +++ b/modules/local/segger/train/main.nf @@ -8,8 +8,8 @@ process SEGGER_TRAIN { tuple val(meta), path(dataset_dir) output: - tuple val(meta), path("${meta.id}_trained_models") , emit: trained_models - path("versions.yml") , emit: versions + tuple val(meta), path("${meta.id}_trained_models"), emit: trained_models + path("versions.yml") , emit: versions when: task.ext.when == null || task.ext.when @@ -28,10 +28,10 @@ process SEGGER_TRAIN { --dataset_dir ${dataset_dir} \\ --models_dir ${prefix}_trained_models \\ --sample_tag ${prefix} \\ + --batch_size ${params.batch_size_train} \\ + --max_epochs ${params.max_epochs} \\ + --devices ${params.devices} \\ --num_workers ${task.cpus} \\ - --batch_size ${task.batch_size} \\ - --max_epochs ${task.max_epochs} \\ - --devices ${task.devices} \\ --accelerator ${params.segger_accelerator} \\ ${args} diff --git a/modules/local/spatialdata/merge/main.nf b/modules/local/spatialdata/merge/main.nf index dbcc00af..8f524734 100644 --- a/modules/local/spatialdata/merge/main.nf +++ b/modules/local/spatialdata/merge/main.nf @@ -9,8 +9,8 @@ process SPATIALDATA_MERGE { path(add_bundle, stageAs: "*") output: - tuple val(meta), path("spatialdata_spatialxe"), emit: spatialxe_bundle - path("versions.yml") , emit: versions + tuple val(meta), path("spatialdata_merged"), emit: merged_bundle + path("versions.yml") , emit: versions when: task.ext.when == null || task.ext.when @@ -27,8 +27,8 @@ process SPATIALDATA_MERGE { stub: """ - mkdir -p "spatialdata_spatialxe/" - touch spatialdata_spatialxe/fake_file.txt + mkdir -p "spatialdata_merged/" + touch spatialdata_merged/fake_file.txt cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/local/spatialdata/merge/templates/merge.py b/modules/local/spatialdata/merge/templates/merge.py index de2f6c4c..6bf908ce 100755 --- a/modules/local/spatialdata/merge/templates/merge.py +++ b/modules/local/spatialdata/merge/templates/merge.py @@ -12,7 +12,7 @@ def main(): reference_bundle = "${ref_bundle}" add_bundle = "${add_bundle}" - output_folder = "./spatialdata_spatialxe" + output_folder = "./spatialdata_merged" # Ensure the output folder exists if os.path.exists(output_folder): diff --git a/modules/local/spatialdata/meta/main.nf b/modules/local/spatialdata/meta/main.nf index 260372aa..ac3c9278 100644 --- a/modules/local/spatialdata/meta/main.nf +++ b/modules/local/spatialdata/meta/main.nf @@ -9,8 +9,8 @@ process SPATIALDATA_META { path(xenium_bundle, stageAs: "*") output: - tuple val(meta), path("spatialdata_spatialxe_final"), emit: spatialxe_bundle - path("versions.yml") , emit: versions + tuple val(meta), path("spatialdata_meta"), emit: metadata + path("versions.yml") , emit: versions when: task.ext.when == null || task.ext.when @@ -28,8 +28,8 @@ process SPATIALDATA_META { stub: """ - mkdir -p "spatialdata_spatialxe_final/" - touch "spatialdata_spatialxe_final/fake_file.txt" + mkdir -p "spatialdata_meta/" + touch "spatialdata_meta/fake_file.txt" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/local/spatialdata/meta/templates/meta.py b/modules/local/spatialdata/meta/templates/meta.py index 91da08af..5c181505 100755 --- a/modules/local/spatialdata/meta/templates/meta.py +++ b/modules/local/spatialdata/meta/templates/meta.py @@ -12,7 +12,7 @@ def main(): spatialdata_bundle = "${spatialdata_bundle}" xenium_bundle = "${xenium_bundle}" metadata = "${meta}" - output = "spatialdata_spatialxe_final" + output = "spatialdata_meta" sdata = sd.read_zarr(f"{spatialdata_bundle}") diff --git a/modules/local/spatialconverter/parquet_to_csv/main.nf b/modules/local/utility/spatialconverter/parquet_to_csv/main.nf similarity index 87% rename from modules/local/spatialconverter/parquet_to_csv/main.nf rename to modules/local/utility/spatialconverter/parquet_to_csv/main.nf index b585aee8..a18019cd 100644 --- a/modules/local/spatialconverter/parquet_to_csv/main.nf +++ b/modules/local/utility/spatialconverter/parquet_to_csv/main.nf @@ -2,7 +2,7 @@ process PARQUET_TO_CSV { tag "$meta.id" label 'process_low' - container "ghcr.io/scverse/spatialdata:spatialdata0.3.0_spatialdata-io0.1.7_spatialdata-plot0.2.9" + container "heylf/spatialdata:0.2.6" input: tuple val(meta), path(transcripts) diff --git a/modules/local/spatialconverter/parquet_to_csv/meta.yml b/modules/local/utility/spatialconverter/parquet_to_csv/meta.yml similarity index 100% rename from modules/local/spatialconverter/parquet_to_csv/meta.yml rename to modules/local/utility/spatialconverter/parquet_to_csv/meta.yml diff --git a/modules/local/spatialconverter/parquet_to_csv/templates/parquet_to_csv.py b/modules/local/utility/spatialconverter/parquet_to_csv/templates/parquet_to_csv.py similarity index 100% rename from modules/local/spatialconverter/parquet_to_csv/templates/parquet_to_csv.py rename to modules/local/utility/spatialconverter/parquet_to_csv/templates/parquet_to_csv.py diff --git a/modules/nf-core/cellpose/cellpose.diff b/modules/nf-core/cellpose/cellpose.diff index eecf7e9b..0267f42c 100644 --- a/modules/nf-core/cellpose/cellpose.diff +++ b/modules/nf-core/cellpose/cellpose.diff @@ -1,5 +1,4 @@ Changes in component 'nf-core/cellpose' -'modules/nf-core/cellpose/meta.yml' is unchanged Changes in 'cellpose/main.nf': --- modules/nf-core/cellpose/main.nf +++ modules/nf-core/cellpose/main.nf @@ -27,7 +26,8 @@ Changes in 'cellpose/main.nf': cat <<-END_VERSIONS > versions.yml "${task.process}": +'modules/nf-core/cellpose/meta.yml' is unchanged 'modules/nf-core/cellpose/tests/main.nf.test' is unchanged -'modules/nf-core/cellpose/tests/main.nf.test.snap' is unchanged 'modules/nf-core/cellpose/tests/nextflow_wflows.config' is unchanged +'modules/nf-core/cellpose/tests/main.nf.test.snap' is unchanged ************************************************************ diff --git a/modules/nf-core/cellpose/main.nf b/modules/nf-core/cellpose/main.nf index 9baa2ae2..e19bd00f 100644 --- a/modules/nf-core/cellpose/main.nf +++ b/modules/nf-core/cellpose/main.nf @@ -2,7 +2,7 @@ process CELLPOSE { tag "$meta.id" label 'process_medium' - container "docker.io/biocontainers/cellpose:3.0.1_cv1" + container "docker.io/biocontainers/cellpose:3.1.0_cv1" input: tuple val(meta), path(image) diff --git a/modules/nf-core/cellpose/meta.yml b/modules/nf-core/cellpose/meta.yml index 5397944b..d0b03732 100644 --- a/modules/nf-core/cellpose/meta.yml +++ b/modules/nf-core/cellpose/meta.yml @@ -24,13 +24,15 @@ input: type: file description: tif file for ready for segmentation pattern: "*.{tif,tiff}" - - - model: - type: file - description: Optional input file. Cellpose 2 model trained by user using human-in-the-loop - approach. + ontologies: [] + - model: + type: file + description: Optional input file. Cellpose 2 model trained by user using human-in-the-loop + approach. + ontologies: [] output: - - mask: - - meta: + mask: + - - meta: type: map description: | Groovy Map containing sample information @@ -39,8 +41,9 @@ output: type: file description: labelled mask output from cellpose in tif format pattern: "*.{tif, tiff}" - - flows: - - meta: + ontologies: [] + flows: + - - meta: type: map description: | Groovy Map containing sample information @@ -49,11 +52,14 @@ output: type: file description: cell flow output from cellpose pattern: "*.{tif}" - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@josenimo" - "@FloWuenne" diff --git a/modules/nf-core/cellpose/tests/main.nf.test.snap b/modules/nf-core/cellpose/tests/main.nf.test.snap index 03b4dbfc..e76ca251 100644 --- a/modules/nf-core/cellpose/tests/main.nf.test.snap +++ b/modules/nf-core/cellpose/tests/main.nf.test.snap @@ -2,31 +2,26 @@ "flows": { "content": [ [ - [ - { - "id": "test" - }, - "cycif_tonsil_registered.ome_flows.tif:md5,de79a792d4bebd2f9753ceb47a0de5f7" - ] + ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.04.6" }, - "timestamp": "2024-03-18T14:22:16.855256249" + "timestamp": "2025-07-04T13:21:35.054592365" }, "versions": { "content": [ [ - "versions.yml:md5,ce42208b574084f390cf58b4c19b5717" + "versions.yml:md5,398393e73a80fc622873765256d5ec79" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.04.6" }, - "timestamp": "2024-03-18T14:22:16.875087557" + "timestamp": "2025-07-04T13:21:35.145644688" }, "cellpose - stub": { "content": [ @@ -43,7 +38,7 @@ ], "2": [ - "versions.yml:md5,ce42208b574084f390cf58b4c19b5717" + "versions.yml:md5,398393e73a80fc622873765256d5ec79" ], "flows": [ @@ -57,15 +52,15 @@ ] ], "versions": [ - "versions.yml:md5,ce42208b574084f390cf58b4c19b5717" + "versions.yml:md5,398393e73a80fc622873765256d5ec79" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.04.6" }, - "timestamp": "2024-03-18T14:22:39.339792992" + "timestamp": "2025-07-04T13:21:52.227498747" }, "mask": { "content": [ @@ -74,14 +69,14 @@ { "id": "test" }, - "cycif_tonsil_registered.ome_cp_masks.tif:md5,001ad312413f18bc2615741bd3ad12cf" + "cycif_tonsil_registered.ome_cp_masks.tif:md5,b151d6718fcb770b2fa3989da632d96e" ] ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.04.6" }, - "timestamp": "2024-03-18T14:22:16.8369758" + "timestamp": "2025-07-04T13:21:34.95450341" } } \ No newline at end of file diff --git a/modules/nf-core/untar/meta.yml b/modules/nf-core/untar/meta.yml index 3a37bb35..1b6bf491 100644 --- a/modules/nf-core/untar/meta.yml +++ b/modules/nf-core/untar/meta.yml @@ -21,9 +21,12 @@ input: type: file description: File to be untar pattern: "*.{tar}.{gz}" + ontologies: + - edam: http://edamontology.org/format_3981 # TAR format + - edam: http://edamontology.org/format_3989 # GZIP format output: - - untar: - - meta: + untar: + - - meta: type: map description: | Groovy Map containing sample information @@ -35,11 +38,13 @@ output: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] pattern: "*/" - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/unzip/meta.yml b/modules/nf-core/unzip/meta.yml index 426fccb7..ba1eb912 100644 --- a/modules/nf-core/unzip/meta.yml +++ b/modules/nf-core/unzip/meta.yml @@ -24,9 +24,11 @@ input: type: file description: ZIP file pattern: "*.zip" + ontologies: + - edam: http://edamontology.org/format_3987 # ZIP format output: - - unzipped_archive: - - meta: + unzipped_archive: + - - meta: type: map description: | Groovy Map containing sample information @@ -35,11 +37,13 @@ output: type: directory description: Directory contents of the unzipped archive pattern: "${archive.baseName}/" - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML authors: - "@jfy133" maintainers: diff --git a/modules/nf-core/unzip/tests/tags.yml b/modules/nf-core/unzip/tests/tags.yml deleted file mode 100644 index 7f5647e1..00000000 --- a/modules/nf-core/unzip/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -unzip: - - "modules/nf-core/unzip/**" diff --git a/nextflow.config b/nextflow.config index 4c1df326..31579809 100644 --- a/nextflow.config +++ b/nextflow.config @@ -58,6 +58,15 @@ params { max_y = 24000.0 min_y = 0.0 + // Segger specific + tile_width = 120 + tile_height = 120 + batch_size_train = 4 // larger batch size can speed up training, but requires more memory + devices = 4 // Use multiple GPUs by increasing the devices parameter to further accelerate training + max_epochs = 200 // increasing #epochs can improve model performance with more learning cycles, but extends training time + batch_size_predict = 1 // larger batch size can speed up training, but requires more memory + cc_analysis = false // to control connected component analysis + // utility modules csplit_x_bins = 2 // number of tiles along the x axis (total number of bins is product of x_bins * y_bins) csplit_y_bins = 2 // number of tiles along the y axis @@ -217,13 +226,10 @@ profiles { test_full { includeConfig 'conf/test_full.config' } } -// Load nf-core custom profiles from different institutions -// If params.custom_config_base is set AND either the NXF_OFFLINE environment variable is not set or params.custom_config_base is a local path, the nfcore_custom.config file from the specified base path is included. -// Load nf-core/spatialxe custom profiles from different institutions. +// Load nf-core custom profiles from different institutions │ includeConfig params.custom_config_base && (!System.getenv('NXF_OFFLINE') || !params.custom_config_base.startsWith('http')) ? "${params.custom_config_base}/nfcore_custom.config" : "/dev/null" - // Load nf-core/spatialxe custom profiles from different institutions. includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${params.custom_config_base}/pipeline/spatialxe.config" : "/dev/null" diff --git a/nextflow_schema.json b/nextflow_schema.json index 7b6e2b0a..ee9641ef 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -208,6 +208,41 @@ "csplit_y_bins": { "type": "integer", "description": "number of slices along the y axis (default - 10)" + }, + "tile_width": { + "type": "integer", + "description": "Width of the tiles in pixels", + "default": 120 + }, + "tile_height": { + "type": "integer", + "description": "Height of the tiles in pixels", + "default": 120 + }, + "batch_size_train": { + "type": "integer", + "description": "Number of samples to process per training batch", + "default": 4 + }, + "devices": { + "type": "integer", + "description": "Number of devices (GPUs) to use during training", + "default": 4 + }, + "max_epochs": { + "type": "integer", + "description": "Number of training epochs", + "default": 200 + }, + "batch_size_predict": { + "type": "integer", + "description": "Number of samples to process per batch during prediction", + "default": 1 + }, + "cc_analysis": { + "type": "boolean", + "description": "Whether to use connected components for grouping transcripts without direct nucleus association", + "default": false } } }, diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index b7dc223a..915409d1 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -23,7 +23,7 @@ "@type": "Dataset", "creativeWorkStatus": "InProgress", "datePublished": "2025-09-09T21:16:18+00:00", - "description": "

\n \n \n \"nf-core/spatialxe\"\n \n

\n\n[![GitHub Actions CI Status](https://github.com/nf-core/spatialxe/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-core/spatialxe/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/spatialxe/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/spatialxe/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/spatialxe/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A524.10.5-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.3.2)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/spatialxe)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23spatialxe-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/spatialxe)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/spatialxe** is a bioinformatics best-practice processing and quality control pipeline for Xenium data. **The pipeline is currently under developement and not completed yet!**. The current plan for the pipeline implementation is shown in the metromap below. Please note that the pipeline steps and methods might change as we move forward in the development cycle.\n\n![nf-core/spatialxe-metromap](docs/images/spatialxe-metromap.png)\n\n\n\n## Usage\n\nOn release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/spatialxe/results).\n\n## Pipeline summary\n\n## Quick Start\n\n`samplesheet.csv`:\n\n```csv\nsample,bundle,image\ntest_sample,/path/to/xenium-bundle,/path/to/morphology.ome.tif\n```\n\nNow, you can run the pipeline using:\n\n\n\n## Run image-based segmentation mode
\n\n`CELLPOSE -> BAYSOR -> XR-IMPORT_SEGMENTATION -> SPATIALDATA -> QC`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode image\n```\n\n## Run coordinate-based segmentation mode
\n\n`PROSEG -> PROSEG2BAYSOR -> XR-IMPORT_SEGMENTATION -> SPATIALDATA -> QC`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode coordinate\n```\n\n## Run segfree mode
\n\n`BAYSOR_SEGFREE`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode segfree\n```\n\n## Run preview mode
\n\n`BAYSOR_PREVIEW`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode preview\n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\nFor more details and further functionality, please refer to the [usage documentation](https://nf-co.re/spatialxe/usage) and the [parameter documentation](https://nf-co.re/spatialxe/parameters).\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/spatialxe/results) tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\n[output documentation](https://nf-co.re/spatialxe/output).\n\n## Credits\n\nnf-core/spatialxe was originally written by [Sameesh Kher](https://github.com/khersameesh24) and [Florian Heyl](https://github.com/heylf).\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- Tobias Krause\n- Kre\u0161imir Be\u0161tak (kbestak)\n- Matthias H\u00f6rtenhuber (mashehu)\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\nFor further information or help, don't hesitate to get in touch on the [Slack `#spatialxe` channel](https://nfcore.slack.com/channels/spatialxe) (you can join with [this invite](https://nf-co.re/join/slack)).\n\n## Citations\n\n\n\n\n\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", + "description": "

\n \n \n \"nf-core/spatialxe\"\n \n

\n\n[![GitHub Actions CI Status](https://github.com/nf-core/spatialxe/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-core/spatialxe/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-core/spatialxe/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-core/spatialxe/actions/workflows/linting.yml)[![AWS CI](https://img.shields.io/badge/CI%20tests-full%20size-FF9900?labelColor=000000&logo=Amazon%20AWS)](https://nf-co.re/spatialxe/results)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A524.10.5-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.3.2-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.3.2)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/spatialxe)\n\n[![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23spatialxe-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/spatialxe)[![Follow on Bluesky](https://img.shields.io/badge/bluesky-%40nf__core-1185fe?labelColor=000000&logo=bluesky)](https://bsky.app/profile/nf-co.re)[![Follow on Mastodon](https://img.shields.io/badge/mastodon-nf__core-6364ff?labelColor=FFFFFF&logo=mastodon)](https://mstdn.science/@nf_core)[![Watch on YouTube](http://img.shields.io/badge/youtube-nf--core-FF0000?labelColor=000000&logo=youtube)](https://www.youtube.com/c/nf-core)\n\n## Introduction\n\n**nf-core/spatialxe** is a bioinformatics best-practice processing and quality control pipeline for Xenium data. **The pipeline is currently under developement and not completed yet!**. The current plan for the pipeline implementation is shown in the metromap below. Please note that the pipeline steps and methods might change as we move forward in the development cycle.\n\n![nf-core/spatialxe-metromap](docs/images/spatialxe-metromap.png)\n\n## Usage\n\nOn release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the [nf-core website](https://nf-co.re/spatialxe/results).\n\n## Pipeline summary\n\n## Quick Start\n\n`samplesheet.csv`:\n\n```csv\nsample,bundle,image\ntest_sample,/path/to/xenium-bundle,/path/to/morphology.ome.tif\n```\n\nNow, you can run the pipeline using:\n\n## Run image-based segmentation mode
\n\n`CELLPOSE -> BAYSOR -> XR-IMPORT_SEGMENTATION -> SPATIALDATA -> QC`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode \n```\n\n## Run coordinate-based segmentation mode
\n\n`PROSEG -> PROSEG2BAYSOR -> XR-IMPORT_SEGMENTATION -> SPATIALDATA -> QC`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode coordinate\n```\n\n## Run segfree mode
\n\n`BAYSOR_SEGFREE`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode segfree\n```\n\n## Run preview mode
\n\n`BAYSOR_PREVIEW`\n\n```bash\nnextflow run nf-core/spatialxe \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \\\n --mode preview\n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\nFor more details and further functionality, please refer to the [usage documentation](https://nf-co.re/spatialxe/usage) and the [parameter documentation](https://nf-co.re/spatialxe/parameters).\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the [results](https://nf-co.re/spatialxe/results) tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\n[output documentation](https://nf-co.re/spatialxe/output).\n\n## Credits\n\nnf-core/spatialxe was originally written by [Sameesh Kher](https://github.com/khersameesh24) and [Florian Heyl](https://github.com/heylf).\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- Tobias Krause\n- Kre\u0161imir Be\u0161tak (kbestak)\n- Matthias H\u00f6rtenhuber (mashehu)\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\nFor further information or help, don't hesitate to get in touch on the [Slack `#spatialxe` channel](https://nfcore.slack.com/channels/spatialxe) (you can join with [this invite](https://nf-co.re/join/slack)).\n\n## Citations\n\n\n\n\n\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nYou can cite the `nf-core` publication as follows:\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", "hasPart": [ { "@id": "main.nf" @@ -138,7 +138,9 @@ "spatial-data-analysis", "spatial-transcriptomics", "transcriptomics", - "xenium" + "xenium", + "xenium_in_situ", + "segmentation" ], "license": [ "MIT" diff --git a/subworkflows/local/baysor_generate_preview/main.nf b/subworkflows/local/baysor_generate_preview/main.nf index 749bce5b..09950ac7 100644 --- a/subworkflows/local/baysor_generate_preview/main.nf +++ b/subworkflows/local/baysor_generate_preview/main.nf @@ -4,7 +4,7 @@ include { BAYSOR_PREVIEW } from '../../../modules/local/baysor/preview/main' include { BAYSOR_CREATE_DATASET } from '../../../modules/local/baysor/create_dataset/main' -include { PARQUET_TO_CSV } from '../../../modules/local/spatialconverter/parquet_to_csv/main' +include { PARQUET_TO_CSV } from '../../../modules/local/utility/spatialconverter/parquet_to_csv/main' workflow BAYSOR_GENERATE_PREVIEW { diff --git a/subworkflows/local/baysor_generate_preview/meta.yml b/subworkflows/local/baysor_generate_preview/meta.yml new file mode 100644 index 00000000..32fbcf92 --- /dev/null +++ b/subworkflows/local/baysor_generate_preview/meta.yml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "baysor_generate_preview" +description: quick preview to get meaning from the data and to get some guesses about the parameters of the full baysor run +keywords: + - baysor + - preview + - transcripts + - report + - preview_html + - html_report + - visualization +components: + - baysor/preview + - baysor/create/dataset + - parquet/to/csv +input: + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] + - ch_config: + description: | + config file for the xenium baysor run (stored in assets/config/xenium.toml) + Structure: [ path("path-to-xenium.toml") ] +output: + - preview_html: + description: | + Preview html file generated with the baysor preview command + Structure: [ val(meta), path("path-to-preview.html") ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/baysor_generate_segfree/main.nf b/subworkflows/local/baysor_generate_segfree/main.nf index 1e4b5f59..54072fdb 100644 --- a/subworkflows/local/baysor_generate_segfree/main.nf +++ b/subworkflows/local/baysor_generate_segfree/main.nf @@ -3,7 +3,7 @@ // include { BAYSOR_SEGFREE } from '../../../modules/local/baysor/segfree/main' - +// include a module to process the output loom file with scapny or anndata workflow BAYSOR_GENERATE_SEGFREE { diff --git a/subworkflows/local/baysor_generate_segfree/meta.yml b/subworkflows/local/baysor_generate_segfree/meta.yml new file mode 100644 index 00000000..f8c951c9 --- /dev/null +++ b/subworkflows/local/baysor_generate_segfree/meta.yml @@ -0,0 +1,32 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "baysor_generate_segfree" +description: with segfree analyses that don't require segmentation, can be run on local neighborhoods instead (Neighborhood Composition Vectors (NCVs)) +keywords: + - baysor + - segfree + - neighborhoods + - loom +components: + - baysor/segfree +input: + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] + - ch_config: + description: | + config file for the xenium baysor run (stored in assets/config/xenium.toml) + Structure: [ path("path-to-xenium.toml") ] +output: + - ncvs: + description: | + loom file generated with the baysor segfree command + Structure: [ val(meta), path("path-to-ncvs.loom") ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/baysor_run_prior_segmentation_mask/main.nf b/subworkflows/local/baysor_run_prior_segmentation_mask/main.nf index 7ec34d97..6c958417 100644 --- a/subworkflows/local/baysor_run_prior_segmentation_mask/main.nf +++ b/subworkflows/local/baysor_run_prior_segmentation_mask/main.nf @@ -87,7 +87,7 @@ workflow BAYSOR_RUN_PRIOR_SEGMENTATION_MASK { coordinate_space = ch_coordinate_space // channel: [ "microns" ] - redefined_bundle = ch_redefined_bundle // channel: [ val(meta), "redefined-xenium-bundle" ] + redefined_bundle = ch_redefined_bundle // channel: [ val(meta), ["redefined-xenium-bundle"] ] versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/baysor_run_prior_segmentation_mask/meta.yml b/subworkflows/local/baysor_run_prior_segmentation_mask/meta.yml new file mode 100644 index 00000000..0ce3b51c --- /dev/null +++ b/subworkflows/local/baysor_run_prior_segmentation_mask/meta.yml @@ -0,0 +1,62 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "baysor_run_prior_segmentation_mask" +description: to run the `baysor run` command if a prior segmentation mask is available +keywords: + - baysor + - baysor run + - segmentation + - segmentation mask + - xeniumranger import-segmentation + - image-based segmentation + - transcript filtering + - polygons +components: + - baysor/preprocess/transcripts + - baysor/run + - xeniumranger/import/segmentation +input: + - ch_bundle_path: + description: | + path to the xenium bundle + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] + - ch_segmentation_mask: + description: | + prior segmentation mask filepath + Structure: [ path("path-to-prior-segmentation-mask.tif") ] + - ch_config: + description: | + config file for the xenium baysor run (stored in assets/config/xenium.toml) + Structure: [ path("path-to-xenium.toml") ] +output: + - segmentation: + description: | + the segmentation.csv file generated from the baysor run command + Structure: [ val(meta), path("segmentation.csv") ] + - polygons2d: + description: | + the segmentation_polygons_2d.json file generated from the baysor run command + Structure: [ val(meta), path("segmentation_polygons_2d.json") ] + - htmls: + description: | + the html files generated from the baysor run command + Structure: [ val(meta), path("*.html") ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("microns") ] + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/baysor_run_transcripts_parquet/main.nf b/subworkflows/local/baysor_run_transcripts_parquet/main.nf index 09037892..2c4f6294 100644 --- a/subworkflows/local/baysor_run_transcripts_parquet/main.nf +++ b/subworkflows/local/baysor_run_transcripts_parquet/main.nf @@ -3,8 +3,8 @@ // // include { SPLIT_TRANSCRIPTS } from '../../../modules/local/utility/split_transcripts/main' -include { BAYSOR_PREPROCESS_TRANSCRIPTS } from '../../../modules/local/baysor/preprocess/main' include { BAYSOR_RUN } from '../../../modules/local/baysor/run/main' +include { BAYSOR_PREPROCESS_TRANSCRIPTS } from '../../../modules/local/baysor/preprocess/main' include { XENIUMRANGER_IMPORT_SEGMENTATION } from '../../../modules/nf-core/xeniumranger/import-segmentation/main' diff --git a/subworkflows/local/baysor_run_transcripts_parquet/meta.yml b/subworkflows/local/baysor_run_transcripts_parquet/meta.yml new file mode 100644 index 00000000..839cb2ce --- /dev/null +++ b/subworkflows/local/baysor_run_transcripts_parquet/meta.yml @@ -0,0 +1,58 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "baysor_run_transcripts_parquet" +description: to run the `baysor run` command with the transcripts.parquet file as a coordinate-based segmentation run +keywords: + - baysor + - baysor run + - segmentation + - xeniumranger import-segmentation + - coordinate-based segmentation + - transcript filtering + - polygons +components: + - baysor/preprocess/transcripts + - baysor/run + - xeniumranger/import/segmentation + - split/transcripts +input: + - ch_bundle_path: + description: | + path to the xenium bundle + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] + - ch_config: + description: | + config file for the xenium baysor run (stored in assets/config/xenium.toml) + Structure: [ path("path-to-xenium.toml") ] +output: + - segmentation: + description: | + the segmentation.csv file generated from the baysor run command + Structure: [ val(meta), path("segmentation.csv") ] + - polygons2d: + description: | + the segmentation_polygons_2d.json file generated from the baysor run command + Structure: [ val(meta), path("segmentation_polygons_2d.json") ] + - htmls: + description: | + the html files generated from the baysor run command + Structure: [ val(meta), path("*.html") ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("microns") ] + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/cellpose_baysor_import_segmentation/main.nf b/subworkflows/local/cellpose_baysor_import_segmentation/main.nf index 03c358f7..f0cb4871 100644 --- a/subworkflows/local/cellpose_baysor_import_segmentation/main.nf +++ b/subworkflows/local/cellpose_baysor_import_segmentation/main.nf @@ -149,15 +149,15 @@ workflow CELLPOSE_BAYSOR_IMPORT_SEGMENTATION { emit: - cells_mask = ch_cellpose_cells_mask // channel: [ val(meta), [ "*masks.tif" ] ] - cells_flows = ch_cellpose_cells_flows // channel: [ val(meta), [ "*flows.tif" ] ] - cells_cells = ch_cellpose_cells_cells // channel: [ val(meta), [ "*seg.npy" ] ] - nuclei_mask = ch_cellpose_nuclei_mask // channel: [ val(meta), [ "*masks.tif" ] ] - nuclei_flows = ch_cellpose_nuclei_flows // channel: [ val(meta), [ "*flows.tif" ] ] - nuclei_cells = ch_cellpose_nuclei_cells // channel: [ val(meta), [ "*seg.npy" ] ] - - segmentation_mask = ch_segmentation // channel: [ val(meta), [ *segmentation.csv ] ] - polygons = ch_polygons // channel: [ val(meta), [ *polygons.json ] ] + cells_mask = ch_cellpose_cells_mask // channel: [ val(meta), [ "*masks.tif" ] ] + cells_flows = ch_cellpose_cells_flows // channel: [ val(meta), [ "*flows.tif" ] ] + cells_cells = ch_cellpose_cells_cells // channel: [ val(meta), [ "*seg.npy" ] ] + nuclei_mask = ch_cellpose_nuclei_mask // channel: [ val(meta), [ "*masks.tif" ] ] + nuclei_flows = ch_cellpose_nuclei_flows // channel: [ val(meta), [ "*flows.tif" ] ] + nuclei_cells = ch_cellpose_nuclei_cells // channel: [ val(meta), [ "*seg.npy" ] ] + + segmentation = ch_segmentation // channel: [ val(meta), [ *segmentation.csv ] ] + polygons2d = ch_polygons // channel: [ val(meta), [ *segmentation_polygons_2d.json ] ] coordinate_space = ch_coordinate_space // channel: [ val("microns") ] diff --git a/subworkflows/local/cellpose_baysor_import_segmentation/meta.yml b/subworkflows/local/cellpose_baysor_import_segmentation/meta.yml new file mode 100644 index 00000000..c58f2213 --- /dev/null +++ b/subworkflows/local/cellpose_baysor_import_segmentation/meta.yml @@ -0,0 +1,88 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "cellpose_baysor_import_segmentation" +description: | + combine image-based segmentation approach with cellpose and integrate results from coordinate-based segmentation + through baysor to run import-segmentation in micron coordinate space +keywords: + - baysor + - cellpose + - baysor run + - segmentation + - xeniumranger import-segmentation + - image-based segmentation + - coordinate-based segmentation + - transcript filtering + - polygons +components: + - cellpose + - resolift + - baysor/preprocess/transcripts + - baysor/run + - xeniumranger/import/segmentation + - split/transcripts +input: + - ch_morphology_image: + description: | + path to the morphology.ome.tif file + Structure: [ val(meta), path("path-to-morphology.ome.tif") ] + - ch_bundle_path: + description: | + path to the xenium bundle + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] + - ch_config: + description: | + config file for the xenium baysor run (stored in assets/config/xenium.toml) + Structure: [ path("path-to-xenium.toml") ] +output: + - cells_mask: + description: | + cell segmentation mask generated by running Cellpose with the cpsam algorithm + Structure: [ val(meta), path("*masks.tif") ] + - cells_flows: + description: | + cell flows generated by running Cellpose with the cpsam algorithm + Structure: [ val(meta), path("*flows.tif") ] + - cells_cells: + description: | + cell segmentation mask as a numpy array generated by running Cellpose with the cpsam algorithm + Structure: [ val(meta), path("*seg.npy") ] + - nuclei_mask: + description: | + nuclei segmentation mask generated by running Cellpose with the nuclei algorithm + Structure: [ val(meta), path("*masks.tif") ] + - nuclei_flows: + description: | + nuclei flows generated by running Cellpose with the nuclei algorithm + Structure: [ val(meta), path("*masks.tif") ] + - nuclei_cells: + description: | + nuclei segmentation mask as a numpy array generated by running Cellpose with the nuclei algorithm + Structure: [ val(meta), path("*seg.npy") ] + - segmentation: + description: | + the segmentation.csv file generated from the baysor run command + Structure: [ val(meta), path("*segmentation.csv") ] + - polygons2d: + description: | + the segmentation_polygons_2d.json file generated from the baysor run command + Structure: [ val(meta), path("*segmentation_polygons_2d.json") ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("microns") ] + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/cellpose_resolift_morphology_ome_tif/meta.yml b/subworkflows/local/cellpose_resolift_morphology_ome_tif/meta.yml new file mode 100644 index 00000000..9dfdc52d --- /dev/null +++ b/subworkflows/local/cellpose_resolift_morphology_ome_tif/meta.yml @@ -0,0 +1,63 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "cellpose_resolift_morphology_ome_tif" +description: | + image-based segmentation approach with cellpose to run import-segmentation in pixel coordinate space +keywords: + - cellpose + - segmentation + - xeniumranger import-segmentation + - image-based segmentation +components: + - cellpose + - resolift + - xeniumranger/import/segmentation +input: + - ch_morphology_image: + description: | + path to the morphology.ome.tif file + Structure: [ val(meta), path("path-to-morphology.ome.tif") ] + - ch_bundle_path: + description: | + path to the xenium bundle + Structure: [ val(meta), path("path-to-xenium-bundle") ] +output: + - cells_mask: + description: | + cell segmentation mask generated by running Cellpose with the cpsam algorithm + Structure: [ val(meta), path("*masks.tif") ] + - cells_flows: + description: | + cell flows generated by running Cellpose with the cpsam algorithm + Structure: [ val(meta), path("*flows.tif") ] + - cells_cells: + description: | + cell segmentation mask as a numpy array generated by running Cellpose with the cpsam algorithm + Structure: [ val(meta), path("*seg.npy") ] + - nuclei_mask: + description: | + nuclei segmentation mask generated by running Cellpose with the nuclei algorithm + Structure: [ val(meta), path("*masks.tif") ] + - nuclei_flows: + description: | + nuclei flows generated by running Cellpose with the nuclei algorithm + Structure: [ val(meta), path("*masks.tif") ] + - nuclei_cells: + description: | + nuclei segmentation mask as a numpy array generated by running Cellpose with the nuclei algorithm + Structure: [ val(meta), path("*seg.npy") ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("pixels") ] + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/ficture_preprocess_model/main.nf b/subworkflows/local/ficture_preprocess_model/main.nf index a43e61ca..7c8d01c7 100644 --- a/subworkflows/local/ficture_preprocess_model/main.nf +++ b/subworkflows/local/ficture_preprocess_model/main.nf @@ -4,7 +4,8 @@ include { FICTURE_PREPROCESS } from '../../../modules/local/ficture/preprocess/main' include { FICTURE } from '../../../modules/local/ficture/model/main' -include { PARQUET_TO_CSV } from '../../../modules/local/spatialconverter/parquet_to_csv/main' +include { PARQUET_TO_CSV } from '../../../modules/local/utility/spatialconverter/parquet_to_csv/main' + workflow FICTURE_PREPROCESS_MODEL { diff --git a/subworkflows/local/ficture_preprocess_model/meta.yml b/subworkflows/local/ficture_preprocess_model/meta.yml new file mode 100644 index 00000000..0a970613 --- /dev/null +++ b/subworkflows/local/ficture_preprocess_model/meta.yml @@ -0,0 +1,38 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "ficture_preprocess_model" +description: Scalable segmentation-free analysis of sub-micron resolution spatial transcriptomics +keywords: + - ficture + - ficture preprocess + - segmentation-free analysis + - pixel level factor analysis +components: + - ficture/preprocess + - ficture + - parquet/to/csv +input: + - ch_transcripts_parquet: + description: | + file containing the molecular or pixel level information, the required columns are X, Y, gene, and Count + Structure: [ val(meta), path("transcripts.parquet") ] + - ch_features: + description: | + unique names of genes that should be used in analysis + Structure: [ [gene1,gene2,gene3,gene4] ] +output: + - transcripts: + description: xyz + - coordinate_minmax: + description: xyz + - features: + description: xyz + - results: + description: xyz + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/proseg_preset_proseg2baysor/main.nf b/subworkflows/local/proseg_preset_proseg2baysor/main.nf index 5694de59..90448094 100644 --- a/subworkflows/local/proseg_preset_proseg2baysor/main.nf +++ b/subworkflows/local/proseg_preset_proseg2baysor/main.nf @@ -4,7 +4,6 @@ include { PROSEG } from '../../../modules/local/proseg/preset/main' include { PROSEG2BAYSOR } from '../../../modules/local/proseg/proseg2baysor/main' -include { PARQUET_TO_CSV } from '../../../modules/local/spatialconverter/parquet_to_csv/main' include { XENIUMRANGER_IMPORT_SEGMENTATION } from '../../../modules/nf-core/xeniumranger/import-segmentation/main' workflow PROSEG_PRESET_PROSEG2BAYSOR { @@ -19,12 +18,8 @@ workflow PROSEG_PRESET_PROSEG2BAYSOR { ch_versions = Channel.empty() ch_coordinate_space = Channel.value("microns") - // run parquet-to-csv - PARQUET_TO_CSV ( ch_transcripts_parquet, ".gz" ) - ch_versions = ch_versions.mix( PARQUET_TO_CSV.out.versions ) - // run proseg with the xenium format - PROSEG ( PARQUET_TO_CSV.out.transcripts_csv ) + PROSEG ( ch_transcripts_parquet ) ch_versions = ch_versions.mix( PROSEG.out.versions ) // run proseg-to-baysor on the data generated with the proseg run diff --git a/subworkflows/local/proseg_preset_proseg2baysor/meta.yml b/subworkflows/local/proseg_preset_proseg2baysor/meta.yml new file mode 100644 index 00000000..ec8ffbbb --- /dev/null +++ b/subworkflows/local/proseg_preset_proseg2baysor/meta.yml @@ -0,0 +1,52 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "proseg_preset_proseg2baysor" +description: to run proseg with the transcripts.parquet file as a coordinate-based segmentation run +keywords: + - proseg + - segmentation + - xeniumranger import-segmentation + - coordinate-based segmentation + - polygons + - metadata +components: + - proseg + - proseg2baysor + - xeniumranger/import/segmentation +input: + - ch_bundle_path: + description: | + path to the xenium bundle + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] +output: + - cell_polygons_2d: + description: | + the cell-polygons.geojson.gz file generated from proseg + Structure: [ val(meta), path("cell-polygons.geojson.gz") ] + - xr_polygons: + description: | + xeniumranger-compatible polygon file generated from the proseg command + Structure: [ val(meta), path("xr-cell-polygons.geojson") ] + - xr_metadata: + description: | + xeniumranger-compatible metadata file generated from the proseg command + Structure: [ val(meta), path("xr-transcript-metadata.csv") ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("microns") ] + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/segger_create_train_predict/main.nf b/subworkflows/local/segger_create_train_predict/main.nf index bd80f66c..f0a95414 100644 --- a/subworkflows/local/segger_create_train_predict/main.nf +++ b/subworkflows/local/segger_create_train_predict/main.nf @@ -12,19 +12,21 @@ workflow SEGGER_CREATE_TRAIN_PREDICT { take: - ch_basedir // channel: [ val(meta), [ "basedir" ] ] - ch_transcripts_parquet // channel: [ val(meta), [bundle + "/transcripts.parquet"]] ch_bundle // channel: [ val(meta), ["path-to-xenium-bundle"] ] + ch_transcripts_parquet // channel: [ val(meta), [bundle + "/transcripts.parquet"]] + main: ch_versions = Channel.empty() + + ch_updated_bundle = Channel.empty() ch_redefined_bundle = Channel.empty() ch_segger_transcripts = Channel.empty() ch_coordinate_space = Channel.value("pixels") // create dataset - SEGGER_CREATE_DATASET ( ch_basedir ) + SEGGER_CREATE_DATASET ( ch_bundle ) ch_versions = ch_versions.mix ( SEGGER_CREATE_DATASET.out.versions ) // train a model with the dataset created @@ -49,27 +51,44 @@ workflow SEGGER_CREATE_TRAIN_PREDICT { SEGGER2XR ( SEGGER_PREDICT.out.transcripts ) ch_versions = ch_versions.mix( SEGGER2XR.out.versions ) - ch_segger_transcripts = SEGGER2XR.out.transcripts_parquet.map { + ch_segger_transcripts_parquet = SEGGER2XR.out.transcripts_parquet.map { _meta, transcripts -> return [ transcripts ] } - // replace transcripts.parquet in xenium bundle - ch_updated_bundle = ch_bundle.map { fileobj -> - if (fileobj.name == 'transcripts.parquet') { - ch_segger_transcripts.val - } else { - fileobj - } + // swap transscripts.parquet with segger transcripts + ch_updated_bundle = ch_bundle.map { _meta, fileobj -> + fileobj == "transcripts.parquet" ? ch_segger_transcripts_parquet : fileobj } // run xeniumranger import-segmentation - XENIUMRANGER_IMPORT_SEGMENTATION ( + cells = ch_updated_bundle.map { _meta, bundle -> + return [ bundle + "/cells.zarr.zip" ] + } + + if ( params.nucleus_segmentation_only ) { + + XENIUMRANGER_IMPORT_SEGMENTATION ( ch_updated_bundle, [], + cells, + cells, + [], + [], + ch_coordinate_space + ) + ch_redefined_bundle = XENIUMRANGER_IMPORT_SEGMENTATION.out.bundle + + ch_versions = ch_versions.mix ( XENIUMRANGER_IMPORT_SEGMENTATION.out.versions ) + + } else { + + XENIUMRANGER_IMPORT_SEGMENTATION ( + ch_updated_bundle, [], [], + cells, [], [], ch_coordinate_space @@ -78,6 +97,7 @@ workflow SEGGER_CREATE_TRAIN_PREDICT { ch_versions = ch_versions.mix ( XENIUMRANGER_IMPORT_SEGMENTATION.out.versions ) + } emit: diff --git a/subworkflows/local/segger_create_train_predict/meta.yml b/subworkflows/local/segger_create_train_predict/meta.yml new file mode 100644 index 00000000..7db69d19 --- /dev/null +++ b/subworkflows/local/segger_create_train_predict/meta.yml @@ -0,0 +1,59 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "segger_create_train_predict" +description: | + segger is a cutting-edge tool for cell segmentation in single-molecule spatial omics datasets, + subworkflow is the implementation of segger modules run in the recommended sequence +keywords: + - segger + - segmentation + - xeniumranger import-segmentation + - coordinate-based segmentation +components: + - segger + - segger/create/dataset + - segger/train + - segger/predict + - segger2xr + - xeniumranger/import/segmentation +input: + - ch_bundle_path: + description: | + Directory containing the raw dataset - xenium bundle (e.g., transcripts, boundaries). + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_transcripts_parquet: + description: | + input parquet file from the xenium bundle + Structure: [ val(meta), path("path-to-transcripts.parquet") ] +output: + - datasetdir: + description: | + Directory generated by the segger create dataset module + Structure: [ val(meta), path(datasetdir) ] + - trained_models: + description: | + The model trained on the data by the segger training module + Structure: [ val(meta), path(trained_models) ] + - benchmarks: + description: | + benchmarks generated from the segger training and prediction steps + Structure: [ val(meta), path(benchmarks) ] + - segger_transcripts: + description: | + transcripts parquet file generated after segger prediction conatining the segger ids + Structure: [ path(transcripts.parquet) ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("pixels") ] + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/spatialdata_write_meta_merge/main.nf b/subworkflows/local/spatialdata_write_meta_merge/main.nf index 6379e85c..47bc385b 100644 --- a/subworkflows/local/spatialdata_write_meta_merge/main.nf +++ b/subworkflows/local/spatialdata_write_meta_merge/main.nf @@ -2,10 +2,10 @@ // generate spatialdata object from the spatialxe layers // +include { SPATIALDATA_META } from '../../../modules/local/spatialdata/meta/main' include { SPATIALDATA_WRITE as SPATIALDATA_WRITE_RAW_BUNDLE } from '../../../modules/local/spatialdata/write/main' -include { SPATIALDATA_WRITE as SPATIALDATA_WRITE_REDEFINED_BUNDLE } from '../../../modules/local/spatialdata/write/main' include { SPATIALDATA_MERGE as SPATIALDATA_MERGE_RAW_REDEFINED } from '../../../modules/local/spatialdata/merge/main' -include { SPATIALDATA_META } from '../../../modules/local/spatialdata/meta/main' +include { SPATIALDATA_WRITE as SPATIALDATA_WRITE_REDEFINED_BUNDLE } from '../../../modules/local/spatialdata/write/main' workflow SPATIALDATA_WRITE_META_MERGE { @@ -18,42 +18,28 @@ workflow SPATIALDATA_WRITE_META_MERGE { ch_versions = Channel.empty() ch_segmented_object = Channel.empty() - ch_cells_as_circles = Channel.empty() // check segmentation - only nuclei, cells or both cells & nuclei if ( params.mode == 'image') { if ( params.nucleus_segmentation_only && params.cell_segmentation_only ) { - ch_segmented_object = Channel.value('cells_and_nuclei') - } - else if ( params.nucleus_segmentation_only ) { - ch_segmented_object = Channel.value('nuclei') - } - else if ( params.cell_segmentation_only ) { - ch_segmented_object = Channel.value('cells') - } else { - ch_segmented_object = Channel.value([]) - } } // set all boundaries as false - default if ( params.mode == 'coordinate') { - ch_segmented_object = Channel.value([]) - } - // write spatialdata object from the raw xenium bundle SPATIALDATA_WRITE_RAW_BUNDLE ( ch_bundle_path, @@ -90,17 +76,17 @@ workflow SPATIALDATA_WRITE_META_MERGE { _meta, bundle -> return [ bundle ] } SPATIALDATA_META ( - SPATIALDATA_MERGE_RAW_REDEFINED.out.spatialxe_bundle, + SPATIALDATA_MERGE_RAW_REDEFINED.out.merged_bundle, ch_just_bundle_path ) ch_versions = ch_versions.mix ( SPATIALDATA_META.out.versions ) emit: - ch_sd_raw = SPATIALDATA_WRITE_RAW_BUNDLE.out.spatialdata // channel: [ val(meta), "spatialdata_raw" ] - ch_sd_redefined = SPATIALDATA_WRITE_REDEFINED_BUNDLE.out.spatialdata // channel: [ val(meta), "spatialdata_redefined" ] - ch_sd_merged = SPATIALDATA_MERGE_RAW_REDEFINED.out.spatialxe_bundle // channel: [ val(meta), "spatialdata_spatialxe" ] - ch_sd_meta = SPATIALDATA_META.out.spatialxe_bundle // channel: [ val(meta), "spatialdata_spatialxe_final" ] + sd_raw_bundle = SPATIALDATA_WRITE_RAW_BUNDLE.out.spatialdata // channel: [ val(meta), "spatialdata_raw" ] + sd_redefined_bundle = SPATIALDATA_WRITE_REDEFINED_BUNDLE.out.spatialdata // channel: [ val(meta), "spatialdata_redefined" ] + sd_merged_bundle = SPATIALDATA_MERGE_RAW_REDEFINED.out.merged_bundle // channel: [ val(meta), "spatialdata_merged" ] + sd_metadata = SPATIALDATA_META.out.metadata // channel: [ val(meta), "spatialdata_meta" ] - versions = ch_versions // channel: [ versions.yml ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/spatialdata_write_meta_merge/meta.yml b/subworkflows/local/spatialdata_write_meta_merge/meta.yml new file mode 100644 index 00000000..f8bfa2c4 --- /dev/null +++ b/subworkflows/local/spatialdata_write_meta_merge/meta.yml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "spatialdata_write_meta_merge" +description: | + SpatialData is a data framework that comprises a FAIR storage format and a collection of python libraries for + performant access, alignment, and processing of uni- and multi-modal spatial omics datasets +keywords: + - spatialdata + - xenium + - xeniumranger import-segmentation + - spatialdata object + - metadata + - merge spatialdata objects +components: + - spatialdata/write + - spatialdata/meta + - spatialdata/merge +input: + - ch_bundle_path: + description: | + Directory containing the raw dataset + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_redefined_bundle: + description: | + Directory containing the redefined xenium bundle after running xeniumranger import-segmentation + Structure: [ val(meta), path("redefined-xenium-bundle") ] + - ch_coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("pixels" or "microns") ] +output: + - sd_raw_bundle: + description: | + spatialdata object generated from the raw xenium bundle + Structure: [ val(meta), path(spatialdata_raw) ] + - sd_redefined_bundle: + description: | + spatialdata object generated from the redefined xenium bundle + Structure: [ val(meta), path(spatialdata_redefined) ] + - sd_merged_bundle: + description: | + spatialdata object generated from merging the spatialdata objects from raw and redefined xenium bundles + Structure: [ val(meta), path(spatialdata_merged) ] + - sd_metadata: + description: | + spatialdata object containing the metadata info. + Structure: [ path(transcripts.parquet) ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/main.nf b/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/main.nf index 2731f4df..e0c9df09 100644 --- a/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/main.nf +++ b/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/main.nf @@ -97,9 +97,9 @@ workflow XENIUMRANGER_IMPORT_SEGMENTATION_REDEFINE_BUNDLE { emit: - coordinate_space = ch_coordinate_space // channel: [ ["pixels"] ] - redefined_bundle = ch_redefined_bundle // channel: [ val(meta), ["redefined-xenium-bundle"] ] + coordinate_space = ch_coordinate_space // channel: [ ["pixels"] ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/meta.yml b/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/meta.yml new file mode 100644 index 00000000..a4be036f --- /dev/null +++ b/subworkflows/local/xeniumranger_import_segmentation_redefine_bundle/meta.yml @@ -0,0 +1,36 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "xeniumranger_import_segmentation_redefine_bundle" +description: | + The import-segmentation pipeline allows you to specify 2D nuclei and/or cell segmentation results to use for + assigning transcripts to cells and recalculate all Xenium Onboard Analysis (XOA) outputs that depend on segmentation. +keywords: + - xenium + - xeniumranger import-segmentation + - qupath + - expansion distance + - segmentation + - polygons +components: + - xeniumranger/import/segmentation +input: + - ch_bundle_path: + description: | + Directory containing the raw dataset + Structure: [ val(meta), path("path-to-xenium-bundle") ] +output: + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("microns") ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/xeniumranger_relabel_resegment/meta.yml b/subworkflows/local/xeniumranger_relabel_resegment/meta.yml new file mode 100644 index 00000000..d8628f4d --- /dev/null +++ b/subworkflows/local/xeniumranger_relabel_resegment/meta.yml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "xeniumranger_relabel_resegment" +description: | + The relabel pipeline allows you to change the gene labels applied to decoded transcripts. + The resegment pipeline allows you to generate a new segmentation of the morphology image space by rerunning the + Xenium Onboard Analysis (XOA) segmentation algorithms with modified parameters. +keywords: + - xenium + - xeniumranger resegment + - expansion distance + - gene panel + - relabel +components: + - xeniumranger/relabel + - xeniumranger/resegment +input: + - ch_bundle_path: + description: | + Directory containing the raw dataset + Structure: [ val(meta), path("path-to-xenium-bundle") ] + - ch_gene_panel: + description: | + The gene panel JSON file to use for relabeling decoded transcripts + Structure: [ path("path-to-gene_panel.json") ] +output: + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/main.nf b/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/main.nf index 84b00a06..ba81cc51 100644 --- a/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/main.nf +++ b/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/main.nf @@ -50,9 +50,9 @@ workflow XENIUMRANGER_RESEGMENT_MORPHOLOGY_OME_TIF { emit: - coordinate_space = ch_coordinate_space // channel: [ ["pixels"] ] - redefined_bundle = ch_redefined_bundle // channel: [ val(meta), ["redefined-xenium-bundle"] ] + coordinate_space = ch_coordinate_space // channel: [ ["pixels"] ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/meta.yml b/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/meta.yml new file mode 100644 index 00000000..db6a07a8 --- /dev/null +++ b/subworkflows/local/xeniumranger_resegment_morphology_ome_tif/meta.yml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "xeniumranger_resegment_morphology_ome_tif" +description: | + The resegment pipeline allows you to generate a new segmentation of the morphology image space by rerunning the + Xenium Onboard Analysis (XOA) segmentation algorithms with modified parameters. +keywords: + - xenium + - xeniumranger resegment + - xeniumranger import-segmentation + - expansion distance + - cell segmentation + - nucleus segmentation +components: + - xeniumranger/import/segmentation + - xeniumranger/resegment +input: + - ch_bundle_path: + description: | + Directory containing the raw dataset + Structure: [ val(meta), path("path-to-xenium-bundle") ] +output: + - redefined_bundle: + description: | + the redefined xenium bundle generated with the segmentation results from baysor + Structure: [ val(meta), ["redefined-xenium-bundle"] ] + - coordinate_space: + description: | + the coordinate space in which xeniumranger import-segmentation was run + Structure: [ val("pixels") ] + - versions: + description: | + Files containing software versions + Structure: [ path(versions.yml) ] +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config index 09ef842a..443e828c 100644 --- a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config @@ -5,4 +5,4 @@ plugins { validation { parametersSchema = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" monochromeLogs = true -} \ No newline at end of file +} diff --git a/workflows/spatialxe.nf b/workflows/spatialxe.nf index f914f98e..d062aa1b 100644 --- a/workflows/spatialxe.nf +++ b/workflows/spatialxe.nf @@ -341,8 +341,7 @@ workflow SPATIALXE { SEGGER_CREATE_TRAIN_PREDICT ( ch_bundle_path, - ch_transcripts_parquet, - ch_bundle_path + ch_transcripts_parquet ) ch_redefined_bundle = SEGGER_CREATE_TRAIN_PREDICT.out.redefined_bundle ch_coordinate_space = SEGGER_CREATE_TRAIN_PREDICT.out.coordinate_space @@ -488,6 +487,13 @@ workflow SPATIALXE { ) ) + // get all files from the redefined bundle + ch_redefined_bundle_files = ch_redefined_bundle.flatMap { _meta, path -> + file("${path}/*") + } + + ch_multiqc_files = ch_multiqc_files.mix ( ch_redefined_bundle_files.collect() ) + MULTIQC ( ch_multiqc_files.collect(), ch_multiqc_config.toList(),