From 9ec866c87d8f5bae489f0c745e9a28bbe0b5dadc Mon Sep 17 00:00:00 2001 From: Sameesh Kher Date: Fri, 17 May 2024 16:37:05 +0200 Subject: [PATCH 01/24] Initial commit for the xeniumranger module --- modules/nf-core/xeniumranger/.gitignore | 0 modules/nf-core/xeniumranger/Dockerfile | 31 ++++++++ modules/nf-core/xeniumranger/README.md | 23 ++++++ .../xeniumranger/import-segmentation/main.nf | 73 +++++++++++++++++++ .../xeniumranger/import-segmentation/meta.yml | 48 ++++++++++++ .../import-segmentation/tests/main.nf.test | 0 .../tests/main.nf.test.snap | 0 .../import-segmentation/tests/nextflow.config | 0 .../import-segmentation/tests/tags.yml | 0 modules/nf-core/xeniumranger/relabel/main.nf | 55 ++++++++++++++ modules/nf-core/xeniumranger/relabel/meta.yml | 46 ++++++++++++ .../xeniumranger/relabel/tests/main.nf.test | 39 ++++++++++ .../relabel/tests/main.nf.test.snap | 0 .../relabel/tests/nextflow.config | 5 ++ .../xeniumranger/relabel/tests/tags.yml | 2 + .../nf-core/xeniumranger/resegment/main.nf | 67 +++++++++++++++++ .../nf-core/xeniumranger/resegment/meta.yml | 42 +++++++++++ .../xeniumranger/resegment/tests/main.nf.test | 0 .../resegment/tests/main.nf.test.snap | 0 .../resegment/tests/nextflow.config | 0 .../xeniumranger/resegment/tests/tags.yml | 0 21 files changed, 431 insertions(+) create mode 100644 modules/nf-core/xeniumranger/.gitignore create mode 100644 modules/nf-core/xeniumranger/Dockerfile create mode 100644 modules/nf-core/xeniumranger/README.md create mode 100644 modules/nf-core/xeniumranger/import-segmentation/main.nf create mode 100644 modules/nf-core/xeniumranger/import-segmentation/meta.yml create mode 100644 modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test create mode 100644 modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap create mode 100644 modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config create mode 100644 modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml create mode 100644 modules/nf-core/xeniumranger/relabel/main.nf create mode 100644 modules/nf-core/xeniumranger/relabel/meta.yml create mode 100644 modules/nf-core/xeniumranger/relabel/tests/main.nf.test create mode 100644 modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap create mode 100644 modules/nf-core/xeniumranger/relabel/tests/nextflow.config create mode 100644 modules/nf-core/xeniumranger/relabel/tests/tags.yml create mode 100644 modules/nf-core/xeniumranger/resegment/main.nf create mode 100644 modules/nf-core/xeniumranger/resegment/meta.yml create mode 100644 modules/nf-core/xeniumranger/resegment/tests/main.nf.test create mode 100644 modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap create mode 100644 modules/nf-core/xeniumranger/resegment/tests/nextflow.config create mode 100644 modules/nf-core/xeniumranger/resegment/tests/tags.yml diff --git a/modules/nf-core/xeniumranger/.gitignore b/modules/nf-core/xeniumranger/.gitignore new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/Dockerfile b/modules/nf-core/xeniumranger/Dockerfile new file mode 100644 index 00000000000..11651d61723 --- /dev/null +++ b/modules/nf-core/xeniumranger/Dockerfile @@ -0,0 +1,31 @@ +# Use a base image with the required operating system +FROM ubuntu:20.04 AS builder + +LABEL authors="Sameesh Kher " \ + description="Docker image containing Xenium Ranger" + +RUN apt-get update --allow-releaseinfo-change \ + && apt-get install -y \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +ARG VERSION="2.0.0" + +# copy over xeniumranger +# xenium ranger has been downloaded from https://www.10xgenomics.com/support/software/xenium-ranger/downloads +COPY xeniumranger-${VERSION}.tar /opt/xeniumranger-${VERSION}.tar + +# install xenium ranger +RUN tar -xzvf /opt/xeniumranger-${VERSION}.tar -C /opt/ && \ + rm /opt/xeniumranger-${VERSION}.tar + +# Set environment variables +ENV PATH="/opt/xeniumranger-xenium2.0/bin:$PATH" + +# multistage to reduce image size +FROM ubuntu:20.04 + +# Set environment variables +ENV PATH="/opt/xeniumranger-xenium2.0/bin:$PATH" + +# copy over xenium from builder +COPY --from=builder /opt/xeniumranger-xenium2.0/ /opt/xeniumranger-xenium2.0/ \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/README.md b/modules/nf-core/xeniumranger/README.md new file mode 100644 index 00000000000..690a5045c63 --- /dev/null +++ b/modules/nf-core/xeniumranger/README.md @@ -0,0 +1,23 @@ +# Updating the docker container and making a new module release + +Xenium Ranger is a commercial tool from 10X Genomics. The container provided for the xeniumranger nf-core module is not provided nor supported by 10x Genomics. Updating the Xenium Ranger versions in the container and pushing the update to Dockerhub needs to be done manually. + +1. Navigate to the appropriate download page. - [Xenium Ranger](https://www.10xgenomics.com/support/software/xenium-ranger/downloads): download the tar ball of the desired Xenium Ranger version with `curl` or `wget`. Place this file in the same folder where the Dockerfile lies. + +2. Edit the Dockerfile. Update the Xenium Ranger versions in this line: +(current version for xenium ranger is fixated at 2.0.0 in the dockerfile) +```bash +ARG VERSION= +``` + +3. Create and test the container: + +```bash +docker build . -t quay.io/nf-core/xeniumranger: +``` + +4. Access rights are needed to push the container to the Dockerhub nfcore organization, please ask a core team member to do so. + +```bash +docker push quay.io/nf-core/xeniumranger: +``` \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf new file mode 100644 index 00000000000..1419aa4fa14 --- /dev/null +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -0,0 +1,73 @@ +process XENIUMRANGER_IMPORT_SEGMENTATION { + tag "$meta.id" + label 'process_high' + + container "docker.io/khersameesh24/xeniumranger2.0" + + input: + path(xenium_bundle) + path(segmentation) + + output: + path("outs/**"), emit: outs + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_IMPORT-SEGMENTATION module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + // image based segmentation + def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" + def coordinate_transform = coordinate_transform ? "--coordinate-transform=\"${coordinate_transform}\"": "" + def nuclei = nuclei ? "--nuclei=\"${xenium_bundle}/cell.zarrr.zip\"": "" + def cells = cells ? "--cells=\"${xenium_bundle}/cells.zarr.zip\"": "" + + // transcript based segmentation + def transcript_assignment = transcript_assignment ? "--transcript-assignment=\"${transcript_assignment}\"": "" + def cell_boundary_polygons = cell_boundary_polygons ? "--viz-polygons=\"${cell_boundary_polygons}\"":"" + + def units = units ? "--units=\"${units}\"": "" + + """ + xeniumranger import-segmentation \\ + --id="${prefix}" \\ + --xenium-bundle="${xenium_bundle}" \\ + --localcores=${task.cpus} \\ + --localmem=${task.memory.toGiga()} \\ + ${nuclei} \\ + ${cells} \\ + ${expansion_distance} \\ + ${transcript_assignment} \\ + ${coordinate_transform} \\ + ${cell_boundary_polygons} \\ + ${units} \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ + + stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_IMPORT-SEGMENTATION module does not support Conda. Please use Docker / Singularity / Podman instead." + } + """ + mkdir -p outs/ + touch outs/fake_file.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/import-segmentation/meta.yml b/modules/nf-core/xeniumranger/import-segmentation/meta.yml new file mode 100644 index 00000000000..cfcfcc59d94 --- /dev/null +++ b/modules/nf-core/xeniumranger/import-segmentation/meta.yml @@ -0,0 +1,48 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation +name: "xeniumranger_import-segmentation" +description: The xeniumranger import-segmentation module allows you to specify 2D nuclei and/or cell segmentation results for assigning transcripts to cells and recalculate all Xenium Onboard Analysis (XOA) outputs that depend on segmentation. Segmentation results can be generated by community-developed tools or prior Xenium segmentation result. +keywords: + - spatial + - segmentation + - import segmentation + - nuclear segmentation + - cell segmentation + - xeniumranger + - imaging +tools: + - "xeniumranger": + description: | + Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. + homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" + documentation: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/getting-started" + tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" + licence: + - "10x Genomics EULA" +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation#input +input: + - xenium_bundle: + type: Path + description: | + Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline + - segmentation_file(s): + type: file + description: | + Segmentation file(s) from community-developed tools. Xenium Ranger supports importing 2D segmentation results. Compatible file formats https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/inputs/XR-input-overview#compat-files +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation#output +output: + - outs: + type: file + description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation#output + pattern: "outs/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@khersameesh24" + - "@heylf" +maintainers: + - "@khersameesh24" + - "@heylf" \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config b/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml b/modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf new file mode 100644 index 00000000000..5ebffc11b41 --- /dev/null +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -0,0 +1,55 @@ +process XENIUMRANGER_RELABEL { + tag "$meta.id" + label 'process_high' + + container "docker.io/khersameesh24/xeniumranger2.0" + + input: + path(xenium_bundle) + path(gene_panel) + + output: + path("outs/**"), emit: outs + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + xeniumranger relabel \\ + --id="${prefix}" \\ + --xenium-bundle="${xenium_bundle}" \\ + --panel="${gene_panel}" \\ + --localcores=${task.cpus} \\ + --localmem=${task.memory.toGiga()} \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ + + stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." + } + """ + mkdir -p outs/ + touch outs/fake_file.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/meta.yml b/modules/nf-core/xeniumranger/relabel/meta.yml new file mode 100644 index 00000000000..7398abd5e0d --- /dev/null +++ b/modules/nf-core/xeniumranger/relabel/meta.yml @@ -0,0 +1,46 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel +name: "xeniumranger_relabel" +description: The xeniumranger relabel module allows you to change the gene labels applied to decoded transcripts. +keywords: + - spatial + - relabel + - gene labels + - transcripts + - xeniumranger +tools: + - "xeniumranger": + description: | + Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. + homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" + documentation: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/getting-started" + tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" + licence: + - "10x Genomics EULA" +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel#input +input: + - xenium_bundle: + type: Path + description: | + Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline + - gene_panel: + type: file + description: | + Gene panel JSON file to use for relabeling decoded transcripts. +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel#output +output: + - outs: + type: file + description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel#output + pattern: "outs/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@khersameesh24" + - "@heylf" +maintainers: + - "@khersameesh24" + - "@heylf" \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test new file mode 100644 index 00000000000..df59d8bd4fe --- /dev/null +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -0,0 +1,39 @@ +nextflow_process { + + name "Test Process XENIUMRANGER_RELABEL" + script "../main.nf" + process "XENIUMRANGER_RELABEL" + + tag "modules" + tag "modules_nfcore" + tag "xeniumranger" + tag "xeniumranger/relabel" + + test("") { + + when { + process { + """ + input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + input[1] = file(params.test_data['gene_panel'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out.versions).match() }, + { assert snapshot( "${process.out.reference[0]}/fasta").match("spaceranger mkref fasta") }, + { assert snapshot( "${process.out.reference[0]}/genes").match("spaceranger mkref genes") }, + { assert snapshot( "${process.out.reference[0]}/reference.json").match("spaceranger mkref reference.json") }, + { assert snapshot( path("${process.out.reference[0]}/star").list().findAll { + it.getFileName().toString() != "genomeParameters.txt" + }).match("spaceranger mkref star") + } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/relabel/tests/nextflow.config b/modules/nf-core/xeniumranger/relabel/tests/nextflow.config new file mode 100644 index 00000000000..e031dfa0a3b --- /dev/null +++ b/modules/nf-core/xeniumranger/relabel/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: XENIUMRANGER_RELABEL { + ext.args = '' + } +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/tags.yml b/modules/nf-core/xeniumranger/relabel/tests/tags.yml new file mode 100644 index 00000000000..d9ef31d1989 --- /dev/null +++ b/modules/nf-core/xeniumranger/relabel/tests/tags.yml @@ -0,0 +1,2 @@ +xeniumranger/relabel: + - "modules/nf-core/xeniumranger/relabel/**" \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/resegment/main.nf b/modules/nf-core/xeniumranger/resegment/main.nf new file mode 100644 index 00000000000..efbe0f9153a --- /dev/null +++ b/modules/nf-core/xeniumranger/resegment/main.nf @@ -0,0 +1,67 @@ +process XENIUMRANGER_RESEGMENT { + tag "$meta.id" + label 'process_high' + + container "docker.io/khersameesh24/xeniumranger2.0" + + input: + path(xenium_bundle) + + output: + path("outs/**"), emit: outs + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_RESEGMENT module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: "" + def prefix = task.ext.prefix ?: "${meta.id}" + + def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" + def resegment_nuclei = resegment_nuclei ? "--resegment-nuclei=\"${resegment_nuclei}\"": "" + def dapi_filter = dapi_filter ? "--dapi-filter=\"${dapi_filter}\"": "" + + // Do not use boundary stain in analysis, but keep default interior stain and DAPI + def boundary_stain = boundary_stain ? "--boundary-stain=disable": "" + // Do not use interior stain in analysis, but keep default boundary stain and DAPI + def interior_stain = interior_stain ? "--interior-stain=disable": "" + + """ + xeniumranger resegment \\ + --id="${prefix}" \\ + --xenium-bundle="${xenium_bundle}" \\ + --localcores=${task.cpus} \\ + --localmem=${task.memory.toGiga()} \\ + ${expansion_distance} \\ + ${resegment_nuclei} \\ + ${dapi_filter} \\ + ${boundary_stain} \\ + ${interior_stain} \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ + + stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_RESEGMENT module does not support Conda. Please use Docker / Singularity / Podman instead." + } + """ + mkdir -p outs/ + touch outs/fake_file.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/resegment/meta.yml b/modules/nf-core/xeniumranger/resegment/meta.yml new file mode 100644 index 00000000000..d80f31f9c35 --- /dev/null +++ b/modules/nf-core/xeniumranger/resegment/meta.yml @@ -0,0 +1,42 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment +name: "xeniumranger_resegment" +description: The xeniumranger resegment module 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: + - spatial + - resegment + - morphology + - segmentation + - xeniumranger +tools: + - "xeniumranger": + description: | + Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. + homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" + documentation: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/getting-started" + tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" + licence: + - "10x Genomics EULA" +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment#input +input: + - xenium_bundle: + type: Path + description: | + Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment#output +output: + - outs: + type: file + description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment#output + pattern: "outs/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@khersameesh24" + - "@heylf" +maintainers: + - "@khersameesh24" + - "@heylf" \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/resegment/tests/nextflow.config b/modules/nf-core/xeniumranger/resegment/tests/nextflow.config new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/resegment/tests/tags.yml b/modules/nf-core/xeniumranger/resegment/tests/tags.yml new file mode 100644 index 00000000000..e69de29bb2d From ae9bc525617151900d0d1ac7f7dcc237a33b3e43 Mon Sep 17 00:00:00 2001 From: Sameesh Kher Date: Fri, 17 May 2024 16:40:35 +0200 Subject: [PATCH 02/24] test file correction, placeholder code for relabel --- modules/nf-core/xeniumranger/relabel/tests/main.nf.test | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index df59d8bd4fe..0e68e96b6ec 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -24,12 +24,10 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( process.out.versions).match() }, - { assert snapshot( "${process.out.reference[0]}/fasta").match("spaceranger mkref fasta") }, - { assert snapshot( "${process.out.reference[0]}/genes").match("spaceranger mkref genes") }, - { assert snapshot( "${process.out.reference[0]}/reference.json").match("spaceranger mkref reference.json") }, + // { assert snapshot( "${process.out.reference[0]}/fasta").match("spaceranger mkref fasta") }, { assert snapshot( path("${process.out.reference[0]}/star").list().findAll { - it.getFileName().toString() != "genomeParameters.txt" - }).match("spaceranger mkref star") + it.getFileName().toString() != "fake.txt" + }).match("xeniumranger relabel") } ) } From 631481cfa3d2920ecbff41610760e4c4c97dc2e2 Mon Sep 17 00:00:00 2001 From: Sameesh Kher Date: Fri, 17 May 2024 21:01:11 +0200 Subject: [PATCH 03/24] minor fix for segmentation input for xenium import-segmentation --- modules/nf-core/xeniumranger/import-segmentation/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf index 1419aa4fa14..691ad5575b1 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/main.nf +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -6,7 +6,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { input: path(xenium_bundle) - path(segmentation) + path(segmentation_file) output: path("outs/**"), emit: outs @@ -26,8 +26,8 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { // image based segmentation def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" def coordinate_transform = coordinate_transform ? "--coordinate-transform=\"${coordinate_transform}\"": "" - def nuclei = nuclei ? "--nuclei=\"${xenium_bundle}/cell.zarrr.zip\"": "" - def cells = cells ? "--cells=\"${xenium_bundle}/cells.zarr.zip\"": "" + def nuclei = nuclei ? "--nuclei=\"${segmentation_file}\"": "" + def cells = cells ? "--cells=\"${segmentation_file}\"": "" // transcript based segmentation def transcript_assignment = transcript_assignment ? "--transcript-assignment=\"${transcript_assignment}\"": "" From fe10e6a3fe714f03da4dce37dc54a8411510f273 Mon Sep 17 00:00:00 2001 From: Sameesh Kher Date: Mon, 20 May 2024 19:00:00 +0200 Subject: [PATCH 04/24] test cases for xenium modules --- .../import-segmentation/tests/main.nf.test | 81 +++++++++++++++++++ .../xeniumranger/relabel/tests/main.nf.test | 49 ++++++++--- .../xeniumranger/resegment/tests/main.nf.test | 72 +++++++++++++++++ 3 files changed, 193 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index e69de29bb2d..ff8497b1166 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -0,0 +1,81 @@ +nextflow_process { + + name "Test Process XENIUMRANGER_IMPORTSEGMENTATION" + script "../main.nf" + process "XENIUMRANGER_IMPORTSEGMENTATION" + + tag "modules" + tag "modules_nfcore" + tag "xeniumranger" + tag "xeniumranger/import-segmentation" + + test("xeniumranger import-segmentation") { + + when { + + process { + """ + input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + input[1] = path(params.segmentation_out['segmentation_json'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', + 'metrics_summary.csv', + 'cell_boundaries.csv.gz', + 'cell_boundaries.parquet', + 'nucleus_boundaries.csv.gz', + 'nucleus_boundaries.parquet', + 'cells.csv.gz', + 'cells.parquet', + 'cells.zarr.zip', + 'transcripts.csv.gz', + 'transcripts.parquet', + 'transcripts.zarr.zip' + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + ) + } + } + + test("xeniumranger import-segmentation -stub") { + + options "-stub" + + when { + + process { + """ + input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index 0e68e96b6ec..cb9e90e211e 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -9,13 +9,14 @@ nextflow_process { tag "xeniumranger" tag "xeniumranger/relabel" - test("") { + test("xeniumranger relabel") { when { + process { """ input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) - input[1] = file(params.test_data['gene_panel'], checkIfExists: true) + input[1] = path(params.test_data['gene_panel'], checkIfExists: true) """ } } @@ -23,15 +24,45 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( process.out.versions).match() }, - // { assert snapshot( "${process.out.reference[0]}/fasta").match("spaceranger mkref fasta") }, - { assert snapshot( path("${process.out.reference[0]}/star").list().findAll { - it.getFileName().toString() != "fake.txt" - }).match("xeniumranger relabel") - } + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'cell_feature_matrix.h5', + 'cell_feature_matrix.zarr.zip', + 'barcodes.tsv.gz' + 'features.tsv.gz' + 'matrix.mtx.gz' + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'barcodes.tsv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'features.tsv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'matrix.mtx.gz' }).exists() } ) } - } + test("xeniumranger relabel -stub") { + + options "-stub" + + when { + + process { + """ + input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + input[1] = path(params.test_data['gene_panel'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index e69de29bb2d..5c900877df5 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -0,0 +1,72 @@ +nextflow_process { + + name "Test Process XENIUMRANGER_RESEGMENT" + script "../main.nf" + process "XENIUMRANGER_RESEGMENT" + + tag "modules" + tag "modules_nfcore" + tag "xeniumranger" + tag "xeniumranger/resegment" + + test("xeniumranger resegment") { + + when { + + process { + """ + input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', + 'cells.csv.gz', + 'cells.parquet', + 'cells.zarr.zip' + 'transcripts.csv.gz' + 'transcripts.parquet', + 'transcripts.zarr.zip', + 'analysis.zarr.zip', + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.csv.gz' }).exists() } + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() } + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() } + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() } + ) + } + } + + test("xeniumranger resegment -stub") { + + options "-stub" + + when { + + process { + """ + input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file From e2a05e25326348164e4640a2819e1456e6b22983 Mon Sep 17 00:00:00 2001 From: Sameesh Kher Date: Tue, 21 May 2024 13:03:54 +0200 Subject: [PATCH 05/24] changes in test config, minor fixes for dockerfile versioning, test suite changes,readme update --- modules/nf-core/xeniumranger/Dockerfile | 18 +++++++------- modules/nf-core/xeniumranger/README.md | 9 ++++--- .../import-segmentation/tests/main.nf.test | 14 ++++++++--- .../xeniumranger/relabel/tests/main.nf.test | 24 +++++++++++++------ .../xeniumranger/resegment/tests/main.nf.test | 12 ++++++++-- tests/config/test_data.config | 11 +++++++++ 6 files changed, 65 insertions(+), 23 deletions(-) diff --git a/modules/nf-core/xeniumranger/Dockerfile b/modules/nf-core/xeniumranger/Dockerfile index 11651d61723..4fe317eac9f 100644 --- a/modules/nf-core/xeniumranger/Dockerfile +++ b/modules/nf-core/xeniumranger/Dockerfile @@ -8,24 +8,26 @@ RUN apt-get update --allow-releaseinfo-change \ && apt-get install -y \ && apt-get clean -y && rm -rf /var/lib/apt/lists/* -ARG VERSION="2.0.0" +ARG MAJOR="2" +ARG MINOR="0" +ARG PATCH="0" # copy over xeniumranger -# xenium ranger has been downloaded from https://www.10xgenomics.com/support/software/xenium-ranger/downloads -COPY xeniumranger-${VERSION}.tar /opt/xeniumranger-${VERSION}.tar +# the latest version of the xeniumranger tool has been downloaded from https://www.10xgenomics.com/support/software/xenium-ranger/downloads +COPY xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar /opt/xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar # install xenium ranger -RUN tar -xzvf /opt/xeniumranger-${VERSION}.tar -C /opt/ && \ - rm /opt/xeniumranger-${VERSION}.tar +RUN tar -xzvf /opt/xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar -C /opt/ && \ + rm /opt/xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar # Set environment variables -ENV PATH="/opt/xeniumranger-xenium2.0/bin:$PATH" +ENV PATH="/opt/xeniumranger-xenium${MAJOR}.${MINOR}/bin:$PATH" # multistage to reduce image size FROM ubuntu:20.04 # Set environment variables -ENV PATH="/opt/xeniumranger-xenium2.0/bin:$PATH" +ENV PATH="/opt/xeniumranger-xenium${MAJOR}.${MINOR}/bin:$PATH" # copy over xenium from builder -COPY --from=builder /opt/xeniumranger-xenium2.0/ /opt/xeniumranger-xenium2.0/ \ No newline at end of file +COPY --from=builder /opt/xeniumranger-xenium${MAJOR}.${MINOR}/ /opt/xeniumranger-xenium${MAJOR}.${MINOR}/ \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/README.md b/modules/nf-core/xeniumranger/README.md index 690a5045c63..fcaa8d58b35 100644 --- a/modules/nf-core/xeniumranger/README.md +++ b/modules/nf-core/xeniumranger/README.md @@ -5,9 +5,12 @@ Xenium Ranger is a commercial tool from 10X Genomics. The container provided for 1. Navigate to the appropriate download page. - [Xenium Ranger](https://www.10xgenomics.com/support/software/xenium-ranger/downloads): download the tar ball of the desired Xenium Ranger version with `curl` or `wget`. Place this file in the same folder where the Dockerfile lies. 2. Edit the Dockerfile. Update the Xenium Ranger versions in this line: -(current version for xenium ranger is fixated at 2.0.0 in the dockerfile) + (current version for xenium ranger is fixated at 2.0.0 in the dockerfile) + ```bash -ARG VERSION= +ARG MAJOR=<#> +ARG MINOR=<#> +ARG PATCH=<#> ``` 3. Create and test the container: @@ -20,4 +23,4 @@ docker build . -t quay.io/nf-core/xeniumranger: ```bash docker push quay.io/nf-core/xeniumranger: -``` \ No newline at end of file +``` diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index ff8497b1166..fe54b6cb9ec 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -13,10 +13,14 @@ nextflow_process { when { + params { + test_data_base = "" + } + process { """ - input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) - input[1] = path(params.segmentation_out['segmentation_json'], checkIfExists: true) + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) + input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['segmentation']['?'], checkIfExists: true) """ } } @@ -64,9 +68,13 @@ nextflow_process { when { + params { + test_data_base = "" + } + process { """ - input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) """ } } diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index cb9e90e211e..3639a1c3c4f 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -13,10 +13,14 @@ nextflow_process { when { + params { + test_data_base = "" + } + process { """ - input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) - input[1] = path(params.test_data['gene_panel'], checkIfExists: true) + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xeniumbundle'], checkIfExists: true) + input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) """ } } @@ -27,14 +31,16 @@ nextflow_process { { assert snapshot( process.out.versions, process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', 'cell_feature_matrix.h5', 'cell_feature_matrix.zarr.zip', - 'barcodes.tsv.gz' - 'features.tsv.gz' - 'matrix.mtx.gz' + 'barcodes.tsv.gz', + 'features.tsv.gz', + 'matrix.mtx.gz', ]} ).match() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'barcodes.tsv.gz' }).exists() }, @@ -50,10 +56,14 @@ nextflow_process { when { + params { + test_data_base = "" + } + process { """ - input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) - input[1] = path(params.test_data['gene_panel'], checkIfExists: true) + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) + input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) """ } } diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index 5c900877df5..7b5ddfa427c 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -13,9 +13,13 @@ nextflow_process { when { + params { + test_data_base = "" + } + process { """ - input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) """ } } @@ -55,9 +59,13 @@ nextflow_process { when { + params { + test_data_base = "" + } + process { """ - input[0] = path(params.test_data['xenium_bundle'], checkIfExists: true) + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) """ } } diff --git a/tests/config/test_data.config b/tests/config/test_data.config index e412f127b68..049067c29ad 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -178,6 +178,17 @@ params { 'txt' { design_matrix = "${params.test_data_base}/data/genomics/mus_musculus/mageck/design_matrix.txt" } + '10xgenomics' { + xeniumranger { + xenium_bundle = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/" + gene_panel = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/gene_panel.json" + 'segmentation' { + baysor = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/baysor.out" + cellpose = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/cellpose.out" + qupath = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/qupath.out" + } + } + } } 'homo_sapiens' { 'genome' { From 8294642a7cde54f172ba3e31475b7a2600238d81 Mon Sep 17 00:00:00 2001 From: Sameesh Kher Date: Fri, 24 May 2024 14:00:31 +0200 Subject: [PATCH 06/24] updated container image for xeniumranger --- modules/nf-core/xeniumranger/import-segmentation/main.nf | 2 +- modules/nf-core/xeniumranger/relabel/main.nf | 2 +- modules/nf-core/xeniumranger/resegment/main.nf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf index 691ad5575b1..35881b99cfa 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/main.nf +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -2,7 +2,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { tag "$meta.id" label 'process_high' - container "docker.io/khersameesh24/xeniumranger2.0" + container "nf-core/xeniumranger:2.0.0" input: path(xenium_bundle) diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf index 5ebffc11b41..145dddb4f8d 100644 --- a/modules/nf-core/xeniumranger/relabel/main.nf +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -2,7 +2,7 @@ process XENIUMRANGER_RELABEL { tag "$meta.id" label 'process_high' - container "docker.io/khersameesh24/xeniumranger2.0" + container "nf-core/xeniumranger:2.0.0" input: path(xenium_bundle) diff --git a/modules/nf-core/xeniumranger/resegment/main.nf b/modules/nf-core/xeniumranger/resegment/main.nf index efbe0f9153a..58eca6fc10d 100644 --- a/modules/nf-core/xeniumranger/resegment/main.nf +++ b/modules/nf-core/xeniumranger/resegment/main.nf @@ -2,7 +2,7 @@ process XENIUMRANGER_RESEGMENT { tag "$meta.id" label 'process_high' - container "docker.io/khersameesh24/xeniumranger2.0" + container "nf-core/xeniumranger:2.0.0" input: path(xenium_bundle) From fee6db0b718973ca3d8a44c570224b9153c93b95 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Thu, 10 Oct 2024 11:54:10 +0200 Subject: [PATCH 07/24] Updated xeniumranger version hence the dockerfile, added newer submodule for xeniumranger rename --- modules/nf-core/xeniumranger/Dockerfile | 16 ++--- modules/nf-core/xeniumranger/README.md | 8 +-- .../xeniumranger/import-segmentation/main.nf | 6 +- .../xeniumranger/import-segmentation/meta.yml | 2 - modules/nf-core/xeniumranger/relabel/main.nf | 6 +- modules/nf-core/xeniumranger/relabel/meta.yml | 2 - modules/nf-core/xeniumranger/rename/main.nf | 58 +++++++++++++++++++ modules/nf-core/xeniumranger/rename/meta.yml | 47 +++++++++++++++ .../nf-core/xeniumranger/resegment/main.nf | 6 +- .../nf-core/xeniumranger/resegment/meta.yml | 2 - 10 files changed, 121 insertions(+), 32 deletions(-) create mode 100644 modules/nf-core/xeniumranger/rename/main.nf create mode 100644 modules/nf-core/xeniumranger/rename/meta.yml diff --git a/modules/nf-core/xeniumranger/Dockerfile b/modules/nf-core/xeniumranger/Dockerfile index 4fe317eac9f..daa3c965c5e 100644 --- a/modules/nf-core/xeniumranger/Dockerfile +++ b/modules/nf-core/xeniumranger/Dockerfile @@ -8,26 +8,22 @@ RUN apt-get update --allow-releaseinfo-change \ && apt-get install -y \ && apt-get clean -y && rm -rf /var/lib/apt/lists/* -ARG MAJOR="2" -ARG MINOR="0" -ARG PATCH="0" - # copy over xeniumranger # the latest version of the xeniumranger tool has been downloaded from https://www.10xgenomics.com/support/software/xenium-ranger/downloads -COPY xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar /opt/xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar +COPY xeniumranger-3.0.1.tar.gz /xeniumranger-3.0.1.tar.gz # install xenium ranger -RUN tar -xzvf /opt/xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar -C /opt/ && \ - rm /opt/xeniumranger-${MAJOR}.${MINOR}.${PATCH}.tar +RUN tar -xzvf /xeniumranger-3.0.1.tar.gz && \ + rm /xeniumranger-3.0.1.tar.gz # Set environment variables -ENV PATH="/opt/xeniumranger-xenium${MAJOR}.${MINOR}/bin:$PATH" +# ENV PATH="xeniumranger-xenium3.0/bin:$PATH" # multistage to reduce image size FROM ubuntu:20.04 # Set environment variables -ENV PATH="/opt/xeniumranger-xenium${MAJOR}.${MINOR}/bin:$PATH" +ENV PATH="/xeniumranger-xenium3.0/bin:$PATH" # copy over xenium from builder -COPY --from=builder /opt/xeniumranger-xenium${MAJOR}.${MINOR}/ /opt/xeniumranger-xenium${MAJOR}.${MINOR}/ \ No newline at end of file +COPY --from=builder /xeniumranger-xenium3.0 /xeniumranger-xenium3.0/ diff --git a/modules/nf-core/xeniumranger/README.md b/modules/nf-core/xeniumranger/README.md index fcaa8d58b35..9bbe56b01c2 100644 --- a/modules/nf-core/xeniumranger/README.md +++ b/modules/nf-core/xeniumranger/README.md @@ -5,13 +5,7 @@ Xenium Ranger is a commercial tool from 10X Genomics. The container provided for 1. Navigate to the appropriate download page. - [Xenium Ranger](https://www.10xgenomics.com/support/software/xenium-ranger/downloads): download the tar ball of the desired Xenium Ranger version with `curl` or `wget`. Place this file in the same folder where the Dockerfile lies. 2. Edit the Dockerfile. Update the Xenium Ranger versions in this line: - (current version for xenium ranger is fixated at 2.0.0 in the dockerfile) - -```bash -ARG MAJOR=<#> -ARG MINOR=<#> -ARG PATCH=<#> -``` + (current version for xenium ranger is fixated at [3.0.1](https://www.10xgenomics.com/support/software/xenium-ranger/downloads) in the dockerfile) 3. Create and test the container: diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf index 35881b99cfa..7c0d45770d0 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/main.nf +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -2,7 +2,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { tag "$meta.id" label 'process_high' - container "nf-core/xeniumranger:2.0.0" + container "nf-core/xeniumranger:3.0.1" input: path(xenium_bundle) @@ -28,7 +28,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { def coordinate_transform = coordinate_transform ? "--coordinate-transform=\"${coordinate_transform}\"": "" def nuclei = nuclei ? "--nuclei=\"${segmentation_file}\"": "" def cells = cells ? "--cells=\"${segmentation_file}\"": "" - + // transcript based segmentation def transcript_assignment = transcript_assignment ? "--transcript-assignment=\"${transcript_assignment}\"": "" def cell_boundary_polygons = cell_boundary_polygons ? "--viz-polygons=\"${cell_boundary_polygons}\"":"" @@ -70,4 +70,4 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/nf-core/xeniumranger/import-segmentation/meta.yml b/modules/nf-core/xeniumranger/import-segmentation/meta.yml index cfcfcc59d94..83e002a34a5 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/meta.yml +++ b/modules/nf-core/xeniumranger/import-segmentation/meta.yml @@ -42,7 +42,5 @@ output: pattern: "versions.yml" authors: - "@khersameesh24" - - "@heylf" maintainers: - "@khersameesh24" - - "@heylf" \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf index 145dddb4f8d..32163c764c6 100644 --- a/modules/nf-core/xeniumranger/relabel/main.nf +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -2,7 +2,7 @@ process XENIUMRANGER_RELABEL { tag "$meta.id" label 'process_high' - container "nf-core/xeniumranger:2.0.0" + container "nf-core/xeniumranger:3.0.1" input: path(xenium_bundle) @@ -22,7 +22,7 @@ process XENIUMRANGER_RELABEL { } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - + """ xeniumranger relabel \\ --id="${prefix}" \\ @@ -52,4 +52,4 @@ process XENIUMRANGER_RELABEL { xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/nf-core/xeniumranger/relabel/meta.yml b/modules/nf-core/xeniumranger/relabel/meta.yml index 7398abd5e0d..448306de4a2 100644 --- a/modules/nf-core/xeniumranger/relabel/meta.yml +++ b/modules/nf-core/xeniumranger/relabel/meta.yml @@ -40,7 +40,5 @@ output: pattern: "versions.yml" authors: - "@khersameesh24" - - "@heylf" maintainers: - "@khersameesh24" - - "@heylf" \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/rename/main.nf b/modules/nf-core/xeniumranger/rename/main.nf new file mode 100644 index 00000000000..ba046379473 --- /dev/null +++ b/modules/nf-core/xeniumranger/rename/main.nf @@ -0,0 +1,58 @@ +process XENIUMRANGER_RENAME { + tag "$meta.id" + label 'process_high' + + container "nf-core/xeniumranger:3.0.1" + + input: + path(xenium_bundle) + + output: + path("outs/**"), emit: outs + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_RENAME module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + def region_name = region_name ? "--region_name=\"${region_name}\"": "" + def cassette_name = cassette_name ? "--cassette_name=\"${cassette_name}\"": "" + + """ + xeniumranger rename \\ + --id="${prefix}" \\ + --xenium-bundle="${xenium_bundle}" \\ + ${region_name} \\ + ${cassette_name} \\ + --localcores=${task.cpus} \\ + --localmem=${task.memory.toGiga()} \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ + + stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." + } + """ + mkdir -p outs/ + touch outs/fake_file.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") + END_VERSIONS + """ +} diff --git a/modules/nf-core/xeniumranger/rename/meta.yml b/modules/nf-core/xeniumranger/rename/meta.yml new file mode 100644 index 00000000000..438c7fbc866 --- /dev/null +++ b/modules/nf-core/xeniumranger/rename/meta.yml @@ -0,0 +1,47 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-rename +name: "xeniumranger_rename" +description: The xeniumranger rename module allows you to change the sample region_name and cassette_name throughout all the Xenium Onboard Analysis output files that contain this information. +keywords: + - spatial + - rename + - gene labels + - transcripts + - xeniumranger +tools: + - "xeniumranger": + description: | + Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. + homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" + documentation: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/getting-started" + tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" + licence: + - "10x Genomics EULA" +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/resources/XR-command-line-arguments#rename +input: + - xenium_bundle: + type: Path + description: | + Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline + - region_name: + type: string + description: | + New region name + - cassette_name: + type: string + description: New cassette name +# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-rename#output +output: + - outs: + type: file + description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/rename#output + pattern: "outs/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/modules/nf-core/xeniumranger/resegment/main.nf b/modules/nf-core/xeniumranger/resegment/main.nf index 58eca6fc10d..72de86a15b9 100644 --- a/modules/nf-core/xeniumranger/resegment/main.nf +++ b/modules/nf-core/xeniumranger/resegment/main.nf @@ -2,7 +2,7 @@ process XENIUMRANGER_RESEGMENT { tag "$meta.id" label 'process_high' - container "nf-core/xeniumranger:2.0.0" + container "nf-core/xeniumranger:3.0.1" input: path(xenium_bundle) @@ -25,7 +25,7 @@ process XENIUMRANGER_RESEGMENT { def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" def resegment_nuclei = resegment_nuclei ? "--resegment-nuclei=\"${resegment_nuclei}\"": "" def dapi_filter = dapi_filter ? "--dapi-filter=\"${dapi_filter}\"": "" - + // Do not use boundary stain in analysis, but keep default interior stain and DAPI def boundary_stain = boundary_stain ? "--boundary-stain=disable": "" // Do not use interior stain in analysis, but keep default boundary stain and DAPI @@ -64,4 +64,4 @@ process XENIUMRANGER_RESEGMENT { xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/nf-core/xeniumranger/resegment/meta.yml b/modules/nf-core/xeniumranger/resegment/meta.yml index d80f31f9c35..cdad1d032e8 100644 --- a/modules/nf-core/xeniumranger/resegment/meta.yml +++ b/modules/nf-core/xeniumranger/resegment/meta.yml @@ -36,7 +36,5 @@ output: pattern: "versions.yml" authors: - "@khersameesh24" - - "@heylf" maintainers: - "@khersameesh24" - - "@heylf" \ No newline at end of file From 54a02a8c1024079512994e70f4b1474d29bd9c72 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Thu, 10 Oct 2024 11:58:32 +0200 Subject: [PATCH 08/24] Updated xeniumranger version hence the dockerfile, added newer submodule for xeniumranger rename --- modules/nf-core/xeniumranger/rename/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/xeniumranger/rename/main.nf b/modules/nf-core/xeniumranger/rename/main.nf index ba046379473..9b1d4c466c5 100644 --- a/modules/nf-core/xeniumranger/rename/main.nf +++ b/modules/nf-core/xeniumranger/rename/main.nf @@ -44,7 +44,7 @@ process XENIUMRANGER_RENAME { stub: // Exit if running this module with -profile conda / -profile mamba if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." + error "XENIUMRANGER_RENAME module does not support Conda. Please use Docker / Singularity / Podman instead." } """ mkdir -p outs/ From 79ed3bac76e2fe3498370c8d5f2439c713a15941 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Fri, 18 Oct 2024 12:38:52 +0200 Subject: [PATCH 09/24] testing xenium modules, tests for rename module --- .../import-segmentation/tests/main.nf.test | 8 --- .../xeniumranger/rename/tests/main.nf.test | 70 +++++++++++++++++++ .../rename/tests/main.nf.test.snap | 0 .../xeniumranger/resegment/tests/main.nf.test | 20 ++---- tests/config/test_data.config | 13 +--- 5 files changed, 77 insertions(+), 34 deletions(-) create mode 100644 modules/nf-core/xeniumranger/rename/tests/main.nf.test create mode 100644 modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index fe54b6cb9ec..9e6f945c4fc 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -13,10 +13,6 @@ nextflow_process { when { - params { - test_data_base = "" - } - process { """ input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) @@ -68,10 +64,6 @@ nextflow_process { when { - params { - test_data_base = "" - } - process { """ input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test b/modules/nf-core/xeniumranger/rename/tests/main.nf.test new file mode 100644 index 00000000000..5def4c8d06c --- /dev/null +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test @@ -0,0 +1,70 @@ +nextflow_process { + + name "Test Process XENIUMRANGER_RENAME" + script "../main.nf" + process "XENIUMRANGER_RENAME" + + tag "modules" + tag "modules_nfcore" + tag "xeniumranger" + tag "xeniumranger/rename" + + test("xeniumranger relabel") { + + when { + + process { + """ + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xeniumbundle'], checkIfExists: true) + input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', + 'cell_feature_matrix.h5', + 'cell_feature_matrix.zarr.zip', + 'barcodes.tsv.gz', + 'features.tsv.gz', + 'matrix.mtx.gz', + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'barcodes.tsv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'features.tsv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'matrix.mtx.gz' }).exists() } + ) + } + } + + test("xeniumranger relabel -stub") { + + options "-stub" + + when { + + process { + """ + input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) + input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index 7b5ddfa427c..e79a928338f 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -13,10 +13,6 @@ nextflow_process { when { - params { - test_data_base = "" - } - process { """ input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) @@ -33,8 +29,8 @@ nextflow_process { 'analysis_summary.html', 'cells.csv.gz', 'cells.parquet', - 'cells.zarr.zip' - 'transcripts.csv.gz' + 'cells.zarr.zip', + 'transcripts.csv.gz', 'transcripts.parquet', 'transcripts.zarr.zip', 'analysis.zarr.zip', @@ -45,10 +41,10 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.csv.gz' }).exists() } - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() } - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() } - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() } + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, ) } } @@ -59,10 +55,6 @@ nextflow_process { when { - params { - test_data_base = "" - } - process { """ input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 049067c29ad..51b4e2b3f2c 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -46,7 +46,7 @@ params { kofamscan_ko_list_gz = "${params.test_data_base}/data/genomics/sarscov2/genome/db/kofamscan/ko_list.gz" metamaps_db = "${params.test_data_base}/data/genomics/sarscov2/genome/db/metamaps_db.tar.gz" - + ncbi_taxmap_zip = "${params.test_data_base}/data/genomics/sarscov2/genome/db/maltextract/ncbi_taxmap.zip" taxon_list_txt = "${params.test_data_base}/data/genomics/sarscov2/genome/db/maltextract/taxon_list.txt" @@ -178,17 +178,6 @@ params { 'txt' { design_matrix = "${params.test_data_base}/data/genomics/mus_musculus/mageck/design_matrix.txt" } - '10xgenomics' { - xeniumranger { - xenium_bundle = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/" - gene_panel = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/gene_panel.json" - 'segmentation' { - baysor = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/baysor.out" - cellpose = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/cellpose.out" - qupath = "${params.test_data_xeniumranger}/data/genomics/mus_musculus/10xgenomics/xeniumranger/qupath.out" - } - } - } } 'homo_sapiens' { 'genome' { From 9fff4252ffcc5eb391b7691268071f62f930b8eb Mon Sep 17 00:00:00 2001 From: w620-admin Date: Fri, 18 Oct 2024 15:46:36 +0200 Subject: [PATCH 10/24] minor fixes for relabel --- modules/nf-core/xeniumranger/relabel/main.nf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf index 32163c764c6..b19bb1caec7 100644 --- a/modules/nf-core/xeniumranger/relabel/main.nf +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -9,7 +9,7 @@ process XENIUMRANGER_RELABEL { path(gene_panel) output: - path("outs/**"), emit: outs + path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: @@ -21,11 +21,11 @@ process XENIUMRANGER_RELABEL { error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." } def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def run_id = task.ext.run_id ?: "${meta.id}" """ xeniumranger relabel \\ - --id="${prefix}" \\ + --id="${run_id}" \\ --xenium-bundle="${xenium_bundle}" \\ --panel="${gene_panel}" \\ --localcores=${task.cpus} \\ @@ -43,9 +43,10 @@ process XENIUMRANGER_RELABEL { if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." } + def run_id = task.ext.run_id ?: "${meta.id}" """ - mkdir -p outs/ - touch outs/fake_file.txt + mkdir -p "${run_id}/outs/" + touch "${run_id}/outs/fake_file.txt" cat <<-END_VERSIONS > versions.yml "${task.process}": From bf94049733082c36475a0df089992a4626ff4ad8 Mon Sep 17 00:00:00 2001 From: w620-admin Date: Fri, 18 Oct 2024 16:16:32 +0200 Subject: [PATCH 11/24] fix for outs directory --- modules/nf-core/xeniumranger/relabel/main.nf | 10 +++++----- modules/nf-core/xeniumranger/rename/main.nf | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf index b19bb1caec7..5c303849dd8 100644 --- a/modules/nf-core/xeniumranger/relabel/main.nf +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -21,11 +21,11 @@ process XENIUMRANGER_RELABEL { error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." } def args = task.ext.args ?: '' - def run_id = task.ext.run_id ?: "${meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}" """ xeniumranger relabel \\ - --id="${run_id}" \\ + --id="${prefix}" \\ --xenium-bundle="${xenium_bundle}" \\ --panel="${gene_panel}" \\ --localcores=${task.cpus} \\ @@ -43,10 +43,10 @@ process XENIUMRANGER_RELABEL { if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { error "XENIUMRANGER_RELABEL module does not support Conda. Please use Docker / Singularity / Podman instead." } - def run_id = task.ext.run_id ?: "${meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}" """ - mkdir -p "${run_id}/outs/" - touch "${run_id}/outs/fake_file.txt" + mkdir -p "${prefix}/outs/" + touch "${prefix}/outs/fake_file.txt" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/xeniumranger/rename/main.nf b/modules/nf-core/xeniumranger/rename/main.nf index 9b1d4c466c5..a8f3469bda8 100644 --- a/modules/nf-core/xeniumranger/rename/main.nf +++ b/modules/nf-core/xeniumranger/rename/main.nf @@ -6,9 +6,11 @@ process XENIUMRANGER_RENAME { input: path(xenium_bundle) + val(region_name) + val(cassette_name) output: - path("outs/**"), emit: outs + path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: @@ -22,15 +24,12 @@ process XENIUMRANGER_RENAME { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def region_name = region_name ? "--region_name=\"${region_name}\"": "" - def cassette_name = cassette_name ? "--cassette_name=\"${cassette_name}\"": "" - """ xeniumranger rename \\ --id="${prefix}" \\ --xenium-bundle="${xenium_bundle}" \\ - ${region_name} \\ - ${cassette_name} \\ + --region-name="${region_name}" \\ + --cassette-name="${cassette_name}" \\ --localcores=${task.cpus} \\ --localmem=${task.memory.toGiga()} \\ ${args} @@ -46,9 +45,10 @@ process XENIUMRANGER_RENAME { if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { error "XENIUMRANGER_RENAME module does not support Conda. Please use Docker / Singularity / Podman instead." } + def prefix = task.ext.prefix ?: "${meta.id}" """ - mkdir -p outs/ - touch outs/fake_file.txt + mkdir -p "${prefix}/outs/" + touch "${prefix}/outs/fake_file.txt" cat <<-END_VERSIONS > versions.yml "${task.process}": From 147e3b3b06d55b037580c549010e9c773b56da3e Mon Sep 17 00:00:00 2001 From: w620-admin Date: Fri, 18 Oct 2024 22:55:22 +0200 Subject: [PATCH 12/24] minor fixes for resegment --- modules/nf-core/xeniumranger/resegment/main.nf | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/nf-core/xeniumranger/resegment/main.nf b/modules/nf-core/xeniumranger/resegment/main.nf index 72de86a15b9..44ffc61d413 100644 --- a/modules/nf-core/xeniumranger/resegment/main.nf +++ b/modules/nf-core/xeniumranger/resegment/main.nf @@ -6,9 +6,13 @@ process XENIUMRANGER_RESEGMENT { input: path(xenium_bundle) + val(expansion_distance) + val(dapi_filter) + val(boundary_stain) + val(interior_stain) output: - path("outs/**"), emit: outs + path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: @@ -23,7 +27,6 @@ process XENIUMRANGER_RESEGMENT { def prefix = task.ext.prefix ?: "${meta.id}" def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" - def resegment_nuclei = resegment_nuclei ? "--resegment-nuclei=\"${resegment_nuclei}\"": "" def dapi_filter = dapi_filter ? "--dapi-filter=\"${dapi_filter}\"": "" // Do not use boundary stain in analysis, but keep default interior stain and DAPI @@ -35,13 +38,12 @@ process XENIUMRANGER_RESEGMENT { xeniumranger resegment \\ --id="${prefix}" \\ --xenium-bundle="${xenium_bundle}" \\ - --localcores=${task.cpus} \\ - --localmem=${task.memory.toGiga()} \\ ${expansion_distance} \\ - ${resegment_nuclei} \\ ${dapi_filter} \\ ${boundary_stain} \\ ${interior_stain} \\ + --localcores=${task.cpus} \\ + --localmem=${task.memory.toGiga()} \\ ${args} cat <<-END_VERSIONS > versions.yml @@ -55,9 +57,10 @@ process XENIUMRANGER_RESEGMENT { if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { error "XENIUMRANGER_RESEGMENT module does not support Conda. Please use Docker / Singularity / Podman instead." } + def prefix = task.ext.prefix ?: "${meta.id}" """ - mkdir -p outs/ - touch outs/fake_file.txt + mkdir -p "${prefix}/outs/" + touch "${prefix}/outs/fake_file.txt" cat <<-END_VERSIONS > versions.yml "${task.process}": From bb1893b5cc558feaac52092b2b5b2c9fe04f6070 Mon Sep 17 00:00:00 2001 From: w620-admin Date: Mon, 21 Oct 2024 15:07:22 +0200 Subject: [PATCH 13/24] tested xeniumranger modules with test data, fixed nf-test, testdata fetch --- .../xeniumranger/import-segmentation/main.nf | 27 ++++--- .../import-segmentation/tests/main.nf.test | 73 +++++++++++------- .../import-segmentation/tests/nextflow.config | 5 ++ modules/nf-core/xeniumranger/relabel/main.nf | 1 + .../xeniumranger/relabel/tests/main.nf.test | 66 ++++++++--------- .../relabel/tests/nextflow.config | 2 +- modules/nf-core/xeniumranger/rename/main.nf | 1 + .../xeniumranger/rename/tests/main.nf.test | 63 +++++++++------- .../xeniumranger/rename/tests/nextflow.config | 3 + .../nf-core/xeniumranger/resegment/main.nf | 1 + .../xeniumranger/resegment/tests/main.nf.test | 74 +++++++++++-------- 11 files changed, 188 insertions(+), 128 deletions(-) create mode 100644 modules/nf-core/xeniumranger/rename/tests/nextflow.config diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf index 7c0d45770d0..f0c5f18a277 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/main.nf +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -5,11 +5,18 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { container "nf-core/xeniumranger:3.0.1" input: + val(meta) path(xenium_bundle) + val(expansion_distance) + path(coordinate_transform) + path(nuclei) + path(cells) + path(transcript_assignment) + path(cell_boundary_polygons) path(segmentation_file) output: - path("outs/**"), emit: outs + path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: @@ -23,17 +30,18 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - // image based segmentation - def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" + // image based segmentation options + def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" // expansion distance (default - 5, range - 0 - 100) def coordinate_transform = coordinate_transform ? "--coordinate-transform=\"${coordinate_transform}\"": "" - def nuclei = nuclei ? "--nuclei=\"${segmentation_file}\"": "" + def nuclei_detection = nuclei ? "--nuclei=\"${nuclei}\"": "" def cells = cells ? "--cells=\"${segmentation_file}\"": "" // transcript based segmentation def transcript_assignment = transcript_assignment ? "--transcript-assignment=\"${transcript_assignment}\"": "" def cell_boundary_polygons = cell_boundary_polygons ? "--viz-polygons=\"${cell_boundary_polygons}\"":"" - def units = units ? "--units=\"${units}\"": "" + // shared argument + def units = coordinate_transform ? "--units=microns": "--units=pixels" """ xeniumranger import-segmentation \\ @@ -41,11 +49,11 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { --xenium-bundle="${xenium_bundle}" \\ --localcores=${task.cpus} \\ --localmem=${task.memory.toGiga()} \\ - ${nuclei} \\ + ${coordinate_transform} \\ + ${nuclei_detection} \\ ${cells} \\ ${expansion_distance} \\ ${transcript_assignment} \\ - ${coordinate_transform} \\ ${cell_boundary_polygons} \\ ${units} \\ ${args} @@ -61,9 +69,10 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { error "XENIUMRANGER_IMPORT-SEGMENTATION module does not support Conda. Please use Docker / Singularity / Podman instead." } + def prefix = task.ext.prefix ?: "${meta.id}" """ - mkdir -p outs/ - touch outs/fake_file.txt + mkdir -p "${prefix}/outs/" + touch "${prefix}/outs/fake_file.txt" cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index 9e6f945c4fc..ac9697a32a6 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -1,32 +1,49 @@ nextflow_process { - name "Test Process XENIUMRANGER_IMPORTSEGMENTATION" + name "Test Process XENIUMRANGER_IMPORT_SEGMENTATION" script "../main.nf" - process "XENIUMRANGER_IMPORTSEGMENTATION" + process "XENIUMRANGER_IMPORT_SEGMENTATION" + config "./nextflow.config" tag "modules" tag "modules_nfcore" tag "xeniumranger" tag "xeniumranger/import-segmentation" + tag "unzip" - test("xeniumranger import-segmentation") { + setup { + run("UNZIP") { + script "modules/nf-core/unzip/main.nf" + process { + """ + input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] + """ + } + } + } + test("xeniumranger import-segmentation") { when { - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) - input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['segmentation']['?'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = 0 + input[3] = [] + input[4] = UNZIP.out.unzipped_archive.map { it[1] } + "/cells.zarr.zip" + input[5] = [] + input[6] = [] + input[7] = [] + input[8] = [] """ } } - then { assertAll( { assert process.success }, { assert snapshot( process.out.versions, - process.out.outs.get(0).get(1).findAll { file(it).name !in [ + process.out.outs.get(0).findAll { file(it).name !in [ 'analysis_summary.html', 'metrics_summary.csv', 'cell_boundaries.csv.gz', @@ -36,41 +53,43 @@ nextflow_process { 'cells.csv.gz', 'cells.parquet', 'cells.zarr.zip', - 'transcripts.csv.gz', 'transcripts.parquet', 'transcripts.zarr.zip' ]} ).match() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, ) } } - test("xeniumranger import-segmentation -stub") { - + test("xeniumranger import-segmentation stub") { options "-stub" - when { - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = 0 + input[3] = [] + input[4] = UNZIP.out.unzipped_archive.map { it[1] } + "/cells.zarr.zip" + input[5] = [] + input[6] = [] + input[7] = [] + input[8] = [] """ } } - then { assertAll( { assert process.success }, diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config b/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config index e69de29bb2d..7f346a59691 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: XENIUMRANGER_IMPORTSEGMENTATION { + ext.args = '' + } +} diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf index 5c303849dd8..6ea033071c6 100644 --- a/modules/nf-core/xeniumranger/relabel/main.nf +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -5,6 +5,7 @@ process XENIUMRANGER_RELABEL { container "nf-core/xeniumranger:3.0.1" input: + val(meta) path(xenium_bundle) path(gene_panel) diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index 3639a1c3c4f..251d7b2cd41 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -3,71 +3,67 @@ nextflow_process { name "Test Process XENIUMRANGER_RELABEL" script "../main.nf" process "XENIUMRANGER_RELABEL" + config "./nextflow.config" tag "modules" tag "modules_nfcore" tag "xeniumranger" tag "xeniumranger/relabel" + tag "unzip" - test("xeniumranger relabel") { - - when { - - params { - test_data_base = "" + setup { + run("UNZIP") { + script "modules/nf-core/unzip/main.nf" + process { + """ + input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] + """ + } } + } + test("xeniumranger relabel") { + when { process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xeniumbundle'], checkIfExists: true) - input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = UNZIP.out.unzipped_archive.map { it[1] } + "/gene_panel.json" """ } } - then { assertAll( { assert process.success }, - { assert snapshot( - process.out.versions, - process.out.outs.get(0).get(1).findAll { file(it).name !in [ - 'analysis_summary.html', - 'cell_feature_matrix.h5', - 'cell_feature_matrix.zarr.zip', - 'barcodes.tsv.gz', - 'features.tsv.gz', - 'matrix.mtx.gz', + { assert process.out.outs != null }, + { + assert snapshot( + process.out.versions, + process.out.outs.get(0).findAll { file(it).name !in [ + "analysis_summary.html", + "cell_feature_matrix.h5", + "cell_feature_matrix.zarr.zip", ]} ).match() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'barcodes.tsv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'features.tsv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'matrix.mtx.gz' }).exists() } + { assert path(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert path(process.out.outs.get(0).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, + { assert path(process.out.outs.get(0).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, ) } } - test("xeniumranger relabel -stub") { - + test("xeniumranger relabel stub") { options "-stub" - when { - - params { - test_data_base = "" - } - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) - input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = UNZIP.out.unzipped_archive.map { it[1] } + "/gene_panel.json" """ } } - then { assertAll( { assert process.success }, diff --git a/modules/nf-core/xeniumranger/relabel/tests/nextflow.config b/modules/nf-core/xeniumranger/relabel/tests/nextflow.config index e031dfa0a3b..3f7ef8a7948 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/nextflow.config +++ b/modules/nf-core/xeniumranger/relabel/tests/nextflow.config @@ -2,4 +2,4 @@ process { withName: XENIUMRANGER_RELABEL { ext.args = '' } -} \ No newline at end of file +} diff --git a/modules/nf-core/xeniumranger/rename/main.nf b/modules/nf-core/xeniumranger/rename/main.nf index a8f3469bda8..b299630f06b 100644 --- a/modules/nf-core/xeniumranger/rename/main.nf +++ b/modules/nf-core/xeniumranger/rename/main.nf @@ -5,6 +5,7 @@ process XENIUMRANGER_RENAME { container "nf-core/xeniumranger:3.0.1" input: + val(meta) path(xenium_bundle) val(region_name) val(cassette_name) diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test b/modules/nf-core/xeniumranger/rename/tests/main.nf.test index 5def4c8d06c..7670064d5d8 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test @@ -3,63 +3,72 @@ nextflow_process { name "Test Process XENIUMRANGER_RENAME" script "../main.nf" process "XENIUMRANGER_RENAME" + config "./nextflow.config" tag "modules" tag "modules_nfcore" tag "xeniumranger" tag "xeniumranger/rename" + tag "unzip" - test("xeniumranger relabel") { + setup { + run("UNZIP") { + script "modules/nf-core/unzip/main.nf" + process { + """ + input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] + """ + } + } + } + test("xeniumranger rename") { when { - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xeniumbundle'], checkIfExists: true) - input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = "test_region" + input[3] = "test_cassette1" """ } } - then { assertAll( { assert process.success }, - { assert snapshot( - process.out.versions, - process.out.outs.get(0).get(1).findAll { file(it).name !in [ - 'analysis_summary.html', - 'cell_feature_matrix.h5', - 'cell_feature_matrix.zarr.zip', - 'barcodes.tsv.gz', - 'features.tsv.gz', - 'matrix.mtx.gz', + { assert process.out.outs != null }, + { + assert snapshot( + process.out.versions, + process.out.outs.get(0).findAll { file(it).name !in [ + 'analysis_summary.html', + 'cell_feature_matrix.h5', + 'cell_feature_matrix.zarr.zip', + 'barcodes.tsv.gz', + 'features.tsv.gz', + 'matrix.mtx.gz', ]} ).match() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'barcodes.tsv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'features.tsv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'matrix.mtx.gz' }).exists() } + { assert file(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'metrics_summary.csv' }).exists() } ) } } - test("xeniumranger relabel -stub") { - + test("xeniumranger rename stub") { options "-stub" - when { - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) - input[1] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['gene_panel'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = "test_region" + input[3] = "test_cassette1" """ } } - then { assertAll( { assert process.success }, diff --git a/modules/nf-core/xeniumranger/rename/tests/nextflow.config b/modules/nf-core/xeniumranger/rename/tests/nextflow.config new file mode 100644 index 00000000000..590eb8defc0 --- /dev/null +++ b/modules/nf-core/xeniumranger/rename/tests/nextflow.config @@ -0,0 +1,3 @@ +params { + test_data_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/testdata/' +} diff --git a/modules/nf-core/xeniumranger/resegment/main.nf b/modules/nf-core/xeniumranger/resegment/main.nf index 44ffc61d413..a27d0254881 100644 --- a/modules/nf-core/xeniumranger/resegment/main.nf +++ b/modules/nf-core/xeniumranger/resegment/main.nf @@ -5,6 +5,7 @@ process XENIUMRANGER_RESEGMENT { container "nf-core/xeniumranger:3.0.1" input: + val(meta) path(xenium_bundle) val(expansion_distance) val(dapi_filter) diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index e79a928338f..4077f401bae 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -3,65 +3,81 @@ nextflow_process { name "Test Process XENIUMRANGER_RESEGMENT" script "../main.nf" process "XENIUMRANGER_RESEGMENT" + config "./nextflow.config" tag "modules" tag "modules_nfcore" tag "xeniumranger" tag "xeniumranger/resegment" + tag "unzip" - test("xeniumranger resegment") { + setup { + run("UNZIP") { + script "modules/nf-core/unzip/main.nf" + process { + """ + input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] + """ + } + } + } + test("xeniumranger resegment") { when { - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] """ } } - then { assertAll( { assert process.success }, - { assert snapshot( - process.out.versions, - process.out.outs.get(0).get(1).findAll { file(it).name !in [ - 'analysis_summary.html', - 'cells.csv.gz', - 'cells.parquet', - 'cells.zarr.zip', - 'transcripts.csv.gz', - 'transcripts.parquet', - 'transcripts.zarr.zip', - 'analysis.zarr.zip', + { assert process.out.outs != null }, + { + assert snapshot( + process.out.versions, + process.out.outs.get(0).findAll { file(it).name !in [ + 'analysis_summary.html', + 'cells.csv.gz', + 'cells.parquet', + 'cells.zarr.zip', + 'transcripts.parquet', + 'transcripts.zarr.zip', + 'analysis.zarr.zip', ]} ).match() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).find { file(it).name == 'analysis.zarr.zip' }).exists() }, ) } } - test("xeniumranger resegment -stub") { - + test("xeniumranger resegment stub") { options "-stub" - when { - process { """ - input[0] = path(params.test_data['mus_musculus']['10xgenomics']['xeniumranger']['xenium_bundle'], checkIfExists: true) + input[0] = [id: "test_run"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] """ } } - then { assertAll( { assert process.success }, From f407f0d6169e2911653bb83a6016a31bf6a48086 Mon Sep 17 00:00:00 2001 From: w620-admin Date: Tue, 22 Oct 2024 16:04:19 +0200 Subject: [PATCH 14/24] fixed linting issues with xenium modules --- .../xeniumranger/import-segmentation/main.nf | 5 +- .../xeniumranger/import-segmentation/meta.yml | 80 +++++++++++----- .../import-segmentation/tests/main.nf.test | 30 +++--- .../tests/main.nf.test.snap | 85 +++++++++++++++++ .../import-segmentation/tests/nextflow.config | 5 - modules/nf-core/xeniumranger/relabel/main.nf | 2 +- modules/nf-core/xeniumranger/relabel/meta.yml | 53 ++++++----- .../xeniumranger/relabel/tests/main.nf.test | 12 +-- .../relabel/tests/main.nf.test.snap | 93 +++++++++++++++++++ .../relabel/tests/nextflow.config | 5 - modules/nf-core/xeniumranger/rename/main.nf | 2 +- modules/nf-core/xeniumranger/rename/meta.yml | 58 +++++++----- .../xeniumranger/rename/tests/main.nf.test | 12 +-- .../rename/tests/main.nf.test.snap | 64 +++++++++++++ .../xeniumranger/rename/tests/nextflow.config | 3 - .../nf-core/xeniumranger/resegment/main.nf | 2 +- .../nf-core/xeniumranger/resegment/meta.yml | 52 +++++++---- .../xeniumranger/resegment/tests/main.nf.test | 20 ++-- .../resegment/tests/main.nf.test.snap | 89 ++++++++++++++++++ 19 files changed, 530 insertions(+), 142 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf index f0c5f18a277..8457632b07b 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/main.nf +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -13,10 +13,9 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { path(cells) path(transcript_assignment) path(cell_boundary_polygons) - path(segmentation_file) output: - path("**/outs/**"), emit: outs + tuple val(meta), path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: @@ -34,7 +33,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" // expansion distance (default - 5, range - 0 - 100) def coordinate_transform = coordinate_transform ? "--coordinate-transform=\"${coordinate_transform}\"": "" def nuclei_detection = nuclei ? "--nuclei=\"${nuclei}\"": "" - def cells = cells ? "--cells=\"${segmentation_file}\"": "" + def cells = cells ? "--cells=\"${cells}\"": "" // transcript based segmentation def transcript_assignment = transcript_assignment ? "--transcript-assignment=\"${transcript_assignment}\"": "" diff --git a/modules/nf-core/xeniumranger/import-segmentation/meta.yml b/modules/nf-core/xeniumranger/import-segmentation/meta.yml index 83e002a34a5..43c193c91a7 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/meta.yml +++ b/modules/nf-core/xeniumranger/import-segmentation/meta.yml @@ -1,8 +1,9 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation -name: "xeniumranger_import-segmentation" -description: The xeniumranger import-segmentation module allows you to specify 2D nuclei and/or cell segmentation results for assigning transcripts to cells and recalculate all Xenium Onboard Analysis (XOA) outputs that depend on segmentation. Segmentation results can be generated by community-developed tools or prior Xenium segmentation result. +name: xeniumranger_import_segmentation +description: The xeniumranger import-segmentation module allows you to specify 2D + nuclei and/or cell segmentation results for assigning transcripts to cells and recalculate + all Xenium Onboard Analysis (XOA) outputs that depend on segmentation. Segmentation + results can be generated by community-developed tools or prior Xenium segmentation + result. keywords: - spatial - segmentation @@ -12,7 +13,7 @@ keywords: - xeniumranger - imaging tools: - - "xeniumranger": + - xeniumranger: description: | Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" @@ -20,26 +21,63 @@ tools: tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" licence: - "10x Genomics EULA" -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation#input + identifier: "" + input: - - xenium_bundle: - type: Path - description: | - Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline - - segmentation_file(s): + - - meta: + type: map + description: | + Groovy Map containing run information + e.g. [id:'xenium_bundle_path'] + - - xenium_bundle: + type: directory + description: Path to the xenium output bundle generated by the Xenium Onboard + Analysis pipeline + - - expansion_distance: + type: integer + description: Nuclei boundary expansion distance in µm. Only for use when nucleus + segmentation provided as input. Default-5 (accepted range 0 - 100) + - - coordinate_transform: type: file - description: | - Segmentation file(s) from community-developed tools. Xenium Ranger supports importing 2D segmentation results. Compatible file formats https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/inputs/XR-input-overview#compat-files -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation#output + description: Image alignment file containing similarity transform matrix e.g., + the _imagealignment.csv file exported from Xenium Explorer + - - nuclei: + type: file + description: | + Label mask (TIFF or NPY), polygons of nucleus segmentations (GeoJSON FeatureCollection), or Xenium Onboard Analysis cells.zarr.zip (the nucleus masks as input). + --nuclei will use nucleusGeometry polygon if it exists in the GeoJSON (i.e., for QuPath-like GeoJSON files), + or geometry if it does not. Error if --transcript-assignment argument is used. + - - cells: + type: file + description: | + Label mask (TIFF or NPY), polygons of cell segmentations (GeoJSON FeatureCollection), or Xenium Onboard Analysis cells.zarr.zip (the cell masks as input). + Features with a non-cell objectType will be ignored. Error if --transcript-assignment argument is used. + In Xenium Ranger v2.0, --nuclei no longer needs to be used with --cells. + - - transcript_assignment: + type: file + description: | + Transcript CSV with cell assignment from Baysor v0.6. Error if --cells or --nuclei arguments are used. + - - cell_boundary_polygons: + type: file + description: | + Cell boundary polygons (GeoJSON) for visualization from Baysor v0.6. Required if --transcript-assignment argument used. Error if --cells or --nuclei arguments used. output: - outs: - type: file - description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-import-segmentation#output - pattern: "outs/*" + - meta: + type: file + description: Files containing the outputs of Cell Ranger, see official 10X Genomics + documentation for a complete list + pattern: "${meta.id}/outs/*" + - "**/outs/**": + type: file + description: Files containing the outputs of xenium ranger, see official 10X + Genomics documentation for a complete list of outputs + pattern: "${meta.id}/outs/*" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@khersameesh24" maintainers: diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index ac9697a32a6..be37a27af47 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -26,7 +26,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_import-segmentation"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = 0 input[3] = [] @@ -34,7 +34,6 @@ nextflow_process { input[5] = [] input[6] = [] input[7] = [] - input[8] = [] """ } } @@ -43,7 +42,7 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.versions, - process.out.outs.get(0).findAll { file(it).name !in [ + process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', 'metrics_summary.csv', 'cell_boundaries.csv.gz', @@ -58,17 +57,17 @@ nextflow_process { ]} ).match() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'metrics_summary.csv' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cells.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cells.parquet' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, ) } } @@ -78,7 +77,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_import-segmentation"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = 0 input[3] = [] @@ -86,7 +85,6 @@ nextflow_process { input[5] = [] input[6] = [] input[7] = [] - input[8] = [] """ } } diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap index e69de29bb2d..b410ce656b8 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap @@ -0,0 +1,85 @@ +{ + "xeniumranger import-segmentation": { + "content": [ + [ + "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" + ], + [ + "analysis.zarr.zip:md5,b995e642539d0b417e357bd81aa7c8ee", + "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", + "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", + "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", + "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", + "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", + "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", + "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", + "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", + "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", + "clusters.csv:md5,12656931988f612717909b9c41ba56f5", + "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", + "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", + "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", + "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", + "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", + "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", + "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", + "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", + "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", + "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", + "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", + "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", + "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", + "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", + "projection.csv:md5,a69578a8549513482d66940b62532670", + "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", + "cell_feature_matrix.zarr.zip:md5,2c54e44dfefb138b8e2bdb6d2d0f34ec", + "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", + "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", + "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", + "experiment.xenium:md5,2f8612ed08c1f470842ecb24c1e094dc", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:15:31.174512" + }, + "xeniumranger import-segmentation stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" + ], + "outs": [ + [ + { + "id": "test_run" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:15:48.116986" + } +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config b/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config index 7f346a59691..e69de29bb2d 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/nextflow.config @@ -1,5 +0,0 @@ -process { - withName: XENIUMRANGER_IMPORTSEGMENTATION { - ext.args = '' - } -} diff --git a/modules/nf-core/xeniumranger/relabel/main.nf b/modules/nf-core/xeniumranger/relabel/main.nf index 6ea033071c6..13b0e678475 100644 --- a/modules/nf-core/xeniumranger/relabel/main.nf +++ b/modules/nf-core/xeniumranger/relabel/main.nf @@ -10,7 +10,7 @@ process XENIUMRANGER_RELABEL { path(gene_panel) output: - path("**/outs/**"), emit: outs + tuple val(meta), path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: diff --git a/modules/nf-core/xeniumranger/relabel/meta.yml b/modules/nf-core/xeniumranger/relabel/meta.yml index 448306de4a2..f2dbd19d16e 100644 --- a/modules/nf-core/xeniumranger/relabel/meta.yml +++ b/modules/nf-core/xeniumranger/relabel/meta.yml @@ -1,8 +1,6 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel -name: "xeniumranger_relabel" -description: The xeniumranger relabel module allows you to change the gene labels applied to decoded transcripts. +name: xeniumranger_relabel +description: The xeniumranger relabel module allows you to change the gene labels + applied to decoded transcripts. keywords: - spatial - relabel @@ -10,34 +8,45 @@ keywords: - transcripts - xeniumranger tools: - - "xeniumranger": + - xeniumranger: description: | Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" documentation: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/getting-started" tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" licence: - - "10x Genomics EULA" -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel#input + - 10x Genomics EULA + identifier: "" input: - - xenium_bundle: - type: Path - description: | - Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline - - gene_panel: + - - meta: + type: map + description: | + Groovy Map containing run information + e.g. [id:'xenium_bundle_path'] + - - xenium_bundle: + type: directory + description: Path to the xenium output bundle generated by the Xenium Onboard + Analysis pipeline + - - gene_panel: type: file - description: | - Gene panel JSON file to use for relabeling decoded transcripts. -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel#output + description: Gene panel JSON file to use for relabeling decoded transcripts output: - outs: - type: file - description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-relabel#output - pattern: "outs/*" + - meta: + type: file + description: Files containing the outputs of Cell Ranger, see official 10X Genomics + documentation for a complete list + pattern: "${meta.id}/outs/*" + - "**/outs/**": + type: file + description: Files containing the outputs of xenium ranger, see official 10X + Genomics documentation for a complete list of outputs + pattern: "${meta.id}/outs/*" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@khersameesh24" maintainers: diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index 251d7b2cd41..3d1c0ee5ac0 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -26,7 +26,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_relabel"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = UNZIP.out.unzipped_archive.map { it[1] } + "/gene_panel.json" """ @@ -39,16 +39,16 @@ nextflow_process { { assert snapshot( process.out.versions, - process.out.outs.get(0).findAll { file(it).name !in [ + process.out.outs.get(0).get(1).findAll { file(it).name !in [ "analysis_summary.html", "cell_feature_matrix.h5", "cell_feature_matrix.zarr.zip", ]} ).match() }, - { assert path(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert path(process.out.outs.get(0).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, - { assert path(process.out.outs.get(0).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, ) } } @@ -58,7 +58,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_relabel"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = UNZIP.out.unzipped_archive.map { it[1] } + "/gene_panel.json" """ diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap index e69de29bb2d..2bcb6e33afe 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap @@ -0,0 +1,93 @@ +{ + "xeniumranger relabel": { + "content": [ + [ + "versions.yml:md5,ab2584177544560d5a9e9c36f7d24354" + ], + [ + "analysis.zarr.zip:md5,86d6fd7796abe3cc53e33439cd278a7c", + "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", + "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", + "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", + "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", + "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", + "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", + "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", + "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", + "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", + "clusters.csv:md5,12656931988f612717909b9c41ba56f5", + "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", + "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", + "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", + "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", + "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", + "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", + "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", + "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", + "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", + "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", + "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", + "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", + "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", + "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", + "projection.csv:md5,a69578a8549513482d66940b62532670", + "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", + "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", + "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", + "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", + "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", + "cells.csv.gz:md5,3cef2d7cc8cfba1d47bdb7c65c3d5d5f", + "cells.parquet:md5,9b30b35ab961d2d243a1426e8dc980fe", + "cells.zarr.zip:md5,556e47d5b14150239b10b2f801defa2b", + "experiment.xenium:md5,5a5b6bccf921a13cd4984c09ec391e33", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "metrics_summary.csv:md5,4386b2545e2d2fb5bcc407b10ed36802", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", + "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", + "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e", + "transcripts.parquet:md5,c0f40d5c61b87404bc9efb84ff0563a8", + "transcripts.zarr.zip:md5,3e02db9c26b2d4e33aa625872b1fe880" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:22:20.356995" + }, + "xeniumranger relabel stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_xeniumranger_relabel" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,ab2584177544560d5a9e9c36f7d24354" + ], + "outs": [ + [ + { + "id": "test_xeniumranger_relabel" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ab2584177544560d5a9e9c36f7d24354" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:22:34.353444" + } +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/nextflow.config b/modules/nf-core/xeniumranger/relabel/tests/nextflow.config index 3f7ef8a7948..e69de29bb2d 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/nextflow.config +++ b/modules/nf-core/xeniumranger/relabel/tests/nextflow.config @@ -1,5 +0,0 @@ -process { - withName: XENIUMRANGER_RELABEL { - ext.args = '' - } -} diff --git a/modules/nf-core/xeniumranger/rename/main.nf b/modules/nf-core/xeniumranger/rename/main.nf index b299630f06b..2226e505190 100644 --- a/modules/nf-core/xeniumranger/rename/main.nf +++ b/modules/nf-core/xeniumranger/rename/main.nf @@ -11,7 +11,7 @@ process XENIUMRANGER_RENAME { val(cassette_name) output: - path("**/outs/**"), emit: outs + tuple val(meta), path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: diff --git a/modules/nf-core/xeniumranger/rename/meta.yml b/modules/nf-core/xeniumranger/rename/meta.yml index 438c7fbc866..26da43bcd99 100644 --- a/modules/nf-core/xeniumranger/rename/meta.yml +++ b/modules/nf-core/xeniumranger/rename/meta.yml @@ -1,8 +1,7 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-rename -name: "xeniumranger_rename" -description: The xeniumranger rename module allows you to change the sample region_name and cassette_name throughout all the Xenium Onboard Analysis output files that contain this information. +name: xeniumranger_rename +description: The xeniumranger rename module allows you to change the sample region_name + and cassette_name throughout all the Xenium Onboard Analysis output files that contain + this information. keywords: - spatial - rename @@ -10,7 +9,7 @@ keywords: - transcripts - xeniumranger tools: - - "xeniumranger": + - xeniumranger: description: | Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" @@ -18,29 +17,38 @@ tools: tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" licence: - "10x Genomics EULA" -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/resources/XR-command-line-arguments#rename + identifier: "" input: - - xenium_bundle: - type: Path - description: | - Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline - - region_name: - type: string - description: | - New region name - - cassette_name: - type: string - description: New cassette name -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-rename#output + - - meta: + type: map + description: Groovy Map containing sample information e.g. [ id:'test' ] + - - xenium_bundle: + type: directory + description: Path to the xenium output bundle generated by the Xenium Onboard + Analysis pipeline + - - region_name: + type: string + description: New region name + - - cassette_name: + type: string + description: New cassette name output: - outs: - type: file - description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/rename#output - pattern: "outs/*" + - meta: + type: file + description: Files containing the outputs of Cell Ranger, see official 10X Genomics + documentation for a complete list + pattern: "${meta.id}/outs/*" + - "**/outs/**": + type: file + description: Files containing the outputs of xenium ranger, see official 10X + Genomics documentation for a complete list of outputs + pattern: "${meta.id}/outs/*" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@khersameesh24" maintainers: diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test b/modules/nf-core/xeniumranger/rename/tests/main.nf.test index 7670064d5d8..2c57a33517c 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test @@ -26,7 +26,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_rename"] input[1] = input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = "test_region" input[3] = "test_cassette1" @@ -40,7 +40,7 @@ nextflow_process { { assert snapshot( process.out.versions, - process.out.outs.get(0).findAll { file(it).name !in [ + process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', 'cell_feature_matrix.h5', 'cell_feature_matrix.zarr.zip', @@ -50,9 +50,9 @@ nextflow_process { ]} ).match() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'experiment.xenium' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'metrics_summary.csv' }).exists() } + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() } ) } } @@ -62,7 +62,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_rename"] input[1] = input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = "test_region" input[3] = "test_cassette1" diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap index e69de29bb2d..8349f331d30 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "xeniumranger rename stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,823917e7bc8f27cf314ef477fe7369eb" + ], + "outs": [ + [ + { + "id": "test_run" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,823917e7bc8f27cf314ef477fe7369eb" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:23:09.592208" + }, + "xeniumranger rename": { + "content": [ + [ + "versions.yml:md5,823917e7bc8f27cf314ef477fe7369eb" + ], + [ + "analysis.zarr.zip:md5,1ffb1b86586fe6c80ce1676b79137785", + "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", + "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", + "cells.csv.gz:md5,3cef2d7cc8cfba1d47bdb7c65c3d5d5f", + "cells.parquet:md5,e1450c7eca3d7ce0d4911c95042b1303", + "cells.zarr.zip:md5,556e47d5b14150239b10b2f801defa2b", + "experiment.xenium:md5,bad9064b95722ad99eb66d1f0c5f1828", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "metrics_summary.csv:md5,2c5412059595b11201bd9b11bc1661af", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", + "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", + "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e", + "transcripts.parquet:md5,203cb05ee7689805cc505ebda9557551", + "transcripts.zarr.zip:md5,807e63a2ef8340e085cd899507f45395" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:22:54.88242" + } +} \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/rename/tests/nextflow.config b/modules/nf-core/xeniumranger/rename/tests/nextflow.config index 590eb8defc0..e69de29bb2d 100644 --- a/modules/nf-core/xeniumranger/rename/tests/nextflow.config +++ b/modules/nf-core/xeniumranger/rename/tests/nextflow.config @@ -1,3 +0,0 @@ -params { - test_data_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/testdata/' -} diff --git a/modules/nf-core/xeniumranger/resegment/main.nf b/modules/nf-core/xeniumranger/resegment/main.nf index a27d0254881..85566cf0f52 100644 --- a/modules/nf-core/xeniumranger/resegment/main.nf +++ b/modules/nf-core/xeniumranger/resegment/main.nf @@ -13,7 +13,7 @@ process XENIUMRANGER_RESEGMENT { val(interior_stain) output: - path("**/outs/**"), emit: outs + tuple val(meta), path("**/outs/**"), emit: outs path "versions.yml", emit: versions when: diff --git a/modules/nf-core/xeniumranger/resegment/meta.yml b/modules/nf-core/xeniumranger/resegment/meta.yml index cdad1d032e8..db14360cf6e 100644 --- a/modules/nf-core/xeniumranger/resegment/meta.yml +++ b/modules/nf-core/xeniumranger/resegment/meta.yml @@ -1,7 +1,4 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment -name: "xeniumranger_resegment" +name: xeniumranger_resegment description: The xeniumranger resegment module 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: - spatial @@ -10,7 +7,7 @@ keywords: - segmentation - xeniumranger tools: - - "xeniumranger": + - xeniumranger: description: | Xenium Ranger is a set of analysis pipelines that process Xenium In Situ Gene Expression data to relabel, resegment, or import new segmentation results from community-developed tools. Xenium Ranger provides flexible off-instrument reanalysis of Xenium In Situ data. Relabel transcripts, resegment cells with the latest 10x segmentation algorithms, or import your own segmentation data to assign transcripts to cells. homepage: "https://www.10xgenomics.com/support/software/xenium-ranger/latest" @@ -18,22 +15,43 @@ tools: tool_dev_url: "https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis" licence: - "10x Genomics EULA" -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment#input + identifier: "" input: - - xenium_bundle: - type: Path - description: | - Path to the xenium output bundle generated by the Xenium Onboard Analysis(XOA) pipeline -# https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment#output + - - meta: + type: map + description: | + Groovy Map containing run information + e.g. [ id:'xenium_experiment' ] + - - xenium_bundle: + type: directory + description: Path to the xenium output bundle generated by the Xenium Onboard Analysis pipeline + - - expansion_distance: + type: integer + description: Nuclei boundary expansion distance in µm. Only for use when nucleus segmentation provided as input. Default-5 (accepted range 0 - 100) + - - dapi_filter: + type: integer + description: Minimum intensity in photoelectrons to filter nuclei default-100 range of values is 0 to 99th percentile of image stack or 1000, whichever is larger + - - boundary_stain: + type: string + description: Specify the name of the boundary stain to use or disable possible options are default-ATP1A1/CD45/E-Cadherin or disable + - - interior_stain: + type: string + description: Specify the name of the interior stain to use or disable possible options are default-18S or disable output: - outs: - type: file - description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list https://www.10xgenomics.com/support/software/xenium-ranger/latest/analysis/running-pipelines/XR-resegment#output - pattern: "outs/*" + - meta: + type: file + description: Files containing the outputs of Cell Ranger, see official 10X Genomics documentation for a complete list + pattern: "${meta.id}/outs/*" + - "**/outs/**": + type: file + description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list of outputs + pattern: "${meta.id}/outs/*" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@khersameesh24" maintainers: diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index 4077f401bae..0ec68ef6b00 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -26,7 +26,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_resegment"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = [] input[3] = [] @@ -42,7 +42,7 @@ nextflow_process { { assert snapshot( process.out.versions, - process.out.outs.get(0).findAll { file(it).name !in [ + process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', 'cells.csv.gz', 'cells.parquet', @@ -53,13 +53,13 @@ nextflow_process { ]} ).match() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cells.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cells.parquet' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, ) } } @@ -69,7 +69,7 @@ nextflow_process { when { process { """ - input[0] = [id: "test_run"] + input[0] = [id: "test_xeniumranger_resegment"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = [] input[3] = [] diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap index e69de29bb2d..51a44b9b0ff 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap @@ -0,0 +1,89 @@ +{ + "xeniumranger resegment stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,4671141281357e0ce26d9cb35fed23a8" + ], + "outs": [ + [ + { + "id": "test_run" + }, + "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,4671141281357e0ce26d9cb35fed23a8" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:58:15.266114" + }, + "xeniumranger resegment": { + "content": [ + [ + "versions.yml:md5,4671141281357e0ce26d9cb35fed23a8" + ], + [ + "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", + "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", + "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", + "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", + "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", + "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", + "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", + "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", + "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", + "clusters.csv:md5,12656931988f612717909b9c41ba56f5", + "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", + "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", + "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", + "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", + "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", + "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", + "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", + "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", + "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", + "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", + "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", + "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", + "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", + "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", + "projection.csv:md5,a69578a8549513482d66940b62532670", + "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", + "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", + "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", + "cell_feature_matrix.zarr.zip:md5,68cfcd0624bd9305f08584f7dde5e9d2", + "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", + "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", + "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", + "experiment.xenium:md5,0fda66bbd54f616aa4b8f1d5290b311f", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "metrics_summary.csv:md5,9f1269bc5f34b000945fc2070c4f1fb1", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", + "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", + "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-22T15:58:01.632344" + } +} \ No newline at end of file From 9b34ee116fc3a93959cc33741445d3ac54334b0e Mon Sep 17 00:00:00 2001 From: w620-admin Date: Tue, 22 Oct 2024 19:24:32 +0200 Subject: [PATCH 15/24] minor typo fix --- modules/nf-core/xeniumranger/rename/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test b/modules/nf-core/xeniumranger/rename/tests/main.nf.test index 2c57a33517c..4fbc3fca8ca 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test @@ -63,7 +63,7 @@ nextflow_process { process { """ input[0] = [id: "test_xeniumranger_rename"] - input[1] = input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = "test_region" input[3] = "test_cassette1" """ From e636fa5bf6b026e1c3e36e3326536ac3c4ef3dd6 Mon Sep 17 00:00:00 2001 From: w620-admin Date: Tue, 22 Oct 2024 19:25:47 +0200 Subject: [PATCH 16/24] minor typo fix --- modules/nf-core/xeniumranger/rename/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test b/modules/nf-core/xeniumranger/rename/tests/main.nf.test index 4fbc3fca8ca..1e6800581e2 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test @@ -27,7 +27,7 @@ nextflow_process { process { """ input[0] = [id: "test_xeniumranger_rename"] - input[1] = input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = "test_region" input[3] = "test_cassette1" """ From 840b977039a4f35d776c66f7ca66a19e1707a563 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Thu, 24 Oct 2024 01:23:39 +0200 Subject: [PATCH 17/24] linting fix, nf-test fix for unstable checksums --- .pre-commit-config.yaml | 6 +- .../import-segmentation/tests/main.nf.test | 20 ++---- .../tests/main.nf.test.snap | 20 +++--- .../import-segmentation/tests/tags.yml | 2 + .../xeniumranger/relabel/tests/main.nf.test | 6 +- .../relabel/tests/main.nf.test.snap | 8 +-- .../xeniumranger/relabel/tests/tags.yml | 2 +- .../xeniumranger/rename/tests/main.nf.test | 10 +-- .../rename/tests/main.nf.test.snap | 13 ++-- .../xeniumranger/rename/tests/tags.yml | 2 + .../nf-core/xeniumranger/resegment/meta.yml | 64 +++++++++---------- .../xeniumranger/resegment/tests/main.nf.test | 3 + .../resegment/tests/main.nf.test.snap | 10 ++- .../xeniumranger/resegment/tests/tags.yml | 2 + 14 files changed, 84 insertions(+), 84 deletions(-) create mode 100644 modules/nf-core/xeniumranger/rename/tests/tags.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32fa31fcc85..b82ab89aff6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "v4.0.0-alpha.8" hooks: - id: prettier additional_dependencies: - prettier@3.2.5 - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.0 + rev: 0.29.4 hooks: - id: check-jsonschema # match meta.ymls in one of the subdirectories of modules/nf-core @@ -18,6 +18,6 @@ repos: args: ["--schemafile", "subworkflows/yaml-schema.json"] - id: check-github-workflows - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 37.236.0 + rev: 38.130.1 hooks: - id: renovate-config-validator diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index be37a27af47..d6152bb29b3 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -44,29 +44,21 @@ nextflow_process { process.out.versions, process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', + 'experiment.xenium', 'metrics_summary.csv', - 'cell_boundaries.csv.gz', - 'cell_boundaries.parquet', - 'nucleus_boundaries.csv.gz', - 'nucleus_boundaries.parquet', - 'cells.csv.gz', - 'cells.parquet', 'cells.zarr.zip', - 'transcripts.parquet', + 'analysis.zarr.zip', + 'cell_feature_matrix.zarr.zip', 'transcripts.zarr.zip' ]} ).match() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, ) } diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap index b410ce656b8..ff976139739 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap @@ -5,7 +5,6 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,b995e642539d0b417e357bd81aa7c8ee", "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", @@ -32,22 +31,27 @@ "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", "projection.csv:md5,a69578a8549513482d66940b62532670", + "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", + "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,2c54e44dfefb138b8e2bdb6d2d0f34ec", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,2f8612ed08c1f470842ecb24c1e094dc", + "cells.csv.gz:md5,3cef2d7cc8cfba1d47bdb7c65c3d5d5f", + "cells.parquet:md5,9b30b35ab961d2d243a1426e8dc980fe", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", - "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", + "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", + "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e", + "transcripts.parquet:md5,c0f40d5c61b87404bc9efb84ff0563a8" ] ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:15:31.174512" + "timestamp": "2024-10-23T23:04:54.909612" }, "xeniumranger import-segmentation stub": { "content": [ @@ -55,7 +59,7 @@ "0": [ [ { - "id": "test_run" + "id": "test_xeniumranger_import-segmentation" }, "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -66,7 +70,7 @@ "outs": [ [ { - "id": "test_run" + "id": "test_xeniumranger_import-segmentation" }, "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -80,6 +84,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:15:48.116986" + "timestamp": "2024-10-22T20:05:05.394111" } } \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml b/modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml index e69de29bb2d..90c2b80563c 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/tags.yml @@ -0,0 +1,2 @@ +xeniumranger/import-segmentation: + - "modules/nf-core/xeniumranger/import-segmentation/**" diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index 3d1c0ee5ac0..080a5afe584 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -40,9 +40,11 @@ nextflow_process { assert snapshot( process.out.versions, process.out.outs.get(0).get(1).findAll { file(it).name !in [ + "analysis.zarr.zip", + "experiment.xenium", + "transcripts.zarr.zip", "analysis_summary.html", - "cell_feature_matrix.h5", - "cell_feature_matrix.zarr.zip", + "cell_feature_matrix.zarr.zip" ]} ).match() }, diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap index 2bcb6e33afe..e6b15659df6 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap @@ -5,7 +5,6 @@ "versions.yml:md5,ab2584177544560d5a9e9c36f7d24354" ], [ - "analysis.zarr.zip:md5,86d6fd7796abe3cc53e33439cd278a7c", "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", @@ -34,28 +33,27 @@ "projection.csv:md5,a69578a8549513482d66940b62532670", "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", + "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", "cells.csv.gz:md5,3cef2d7cc8cfba1d47bdb7c65c3d5d5f", "cells.parquet:md5,9b30b35ab961d2d243a1426e8dc980fe", "cells.zarr.zip:md5,556e47d5b14150239b10b2f801defa2b", - "experiment.xenium:md5,5a5b6bccf921a13cd4984c09ec391e33", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "metrics_summary.csv:md5,4386b2545e2d2fb5bcc407b10ed36802", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e", - "transcripts.parquet:md5,c0f40d5c61b87404bc9efb84ff0563a8", - "transcripts.zarr.zip:md5,3e02db9c26b2d4e33aa625872b1fe880" + "transcripts.parquet:md5,c0f40d5c61b87404bc9efb84ff0563a8" ] ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:22:20.356995" + "timestamp": "2024-10-23T17:52:18.112349" }, "xeniumranger relabel stub": { "content": [ diff --git a/modules/nf-core/xeniumranger/relabel/tests/tags.yml b/modules/nf-core/xeniumranger/relabel/tests/tags.yml index d9ef31d1989..1cb37a80de0 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/tags.yml +++ b/modules/nf-core/xeniumranger/relabel/tests/tags.yml @@ -1,2 +1,2 @@ xeniumranger/relabel: - - "modules/nf-core/xeniumranger/relabel/**" \ No newline at end of file + - "modules/nf-core/xeniumranger/relabel/**" diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test b/modules/nf-core/xeniumranger/rename/tests/main.nf.test index 1e6800581e2..e6e21e96813 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test @@ -29,7 +29,7 @@ nextflow_process { input[0] = [id: "test_xeniumranger_rename"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = "test_region" - input[3] = "test_cassette1" + input[3] = "test_cassette" """ } } @@ -42,11 +42,7 @@ nextflow_process { process.out.versions, process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', - 'cell_feature_matrix.h5', - 'cell_feature_matrix.zarr.zip', - 'barcodes.tsv.gz', - 'features.tsv.gz', - 'matrix.mtx.gz', + 'experiment.xenium', ]} ).match() }, @@ -65,7 +61,7 @@ nextflow_process { input[0] = [id: "test_xeniumranger_rename"] input[1] = UNZIP.out.unzipped_archive.map { it[1] } input[2] = "test_region" - input[3] = "test_cassette1" + input[3] = "test_cassette" """ } } diff --git a/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap index 8349f331d30..0ab60c31077 100644 --- a/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/rename/tests/main.nf.test.snap @@ -5,7 +5,7 @@ "0": [ [ { - "id": "test_run" + "id": "test_xeniumranger_rename" }, "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -16,7 +16,7 @@ "outs": [ [ { - "id": "test_run" + "id": "test_xeniumranger_rename" }, "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -30,7 +30,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:23:09.592208" + "timestamp": "2024-10-22T20:12:43.026607" }, "xeniumranger rename": { "content": [ @@ -41,12 +41,13 @@ "analysis.zarr.zip:md5,1ffb1b86586fe6c80ce1676b79137785", "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", + "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", + "cell_feature_matrix.zarr.zip:md5,36f45a290cf4ee1232f2d1cd0fdbd820", "cells.csv.gz:md5,3cef2d7cc8cfba1d47bdb7c65c3d5d5f", "cells.parquet:md5,e1450c7eca3d7ce0d4911c95042b1303", "cells.zarr.zip:md5,556e47d5b14150239b10b2f801defa2b", - "experiment.xenium:md5,bad9064b95722ad99eb66d1f0c5f1828", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", - "metrics_summary.csv:md5,2c5412059595b11201bd9b11bc1661af", + "metrics_summary.csv:md5,54ad3944eb3ba6a4d7bda01bc2a6bb1c", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", @@ -59,6 +60,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:22:54.88242" + "timestamp": "2024-10-23T18:41:44.42271" } } \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/rename/tests/tags.yml b/modules/nf-core/xeniumranger/rename/tests/tags.yml new file mode 100644 index 00000000000..1f9026ac618 --- /dev/null +++ b/modules/nf-core/xeniumranger/rename/tests/tags.yml @@ -0,0 +1,2 @@ +xeniumranger/rename: + - "modules/nf-core/xeniumranger/rename/**" diff --git a/modules/nf-core/xeniumranger/resegment/meta.yml b/modules/nf-core/xeniumranger/resegment/meta.yml index db14360cf6e..9bf71449ba3 100644 --- a/modules/nf-core/xeniumranger/resegment/meta.yml +++ b/modules/nf-core/xeniumranger/resegment/meta.yml @@ -17,41 +17,41 @@ tools: - "10x Genomics EULA" identifier: "" input: - - - meta: - type: map - description: | - Groovy Map containing run information - e.g. [ id:'xenium_experiment' ] - - - xenium_bundle: - type: directory - description: Path to the xenium output bundle generated by the Xenium Onboard Analysis pipeline - - - expansion_distance: - type: integer - description: Nuclei boundary expansion distance in µm. Only for use when nucleus segmentation provided as input. Default-5 (accepted range 0 - 100) - - - dapi_filter: - type: integer - description: Minimum intensity in photoelectrons to filter nuclei default-100 range of values is 0 to 99th percentile of image stack or 1000, whichever is larger - - - boundary_stain: - type: string - description: Specify the name of the boundary stain to use or disable possible options are default-ATP1A1/CD45/E-Cadherin or disable - - - interior_stain: - type: string - description: Specify the name of the interior stain to use or disable possible options are default-18S or disable + - - meta: + type: map + description: | + Groovy Map containing run information + e.g. [ id:'xenium_experiment' ] + - - xenium_bundle: + type: directory + description: Path to the xenium output bundle generated by the Xenium Onboard Analysis pipeline + - - expansion_distance: + type: integer + description: Nuclei boundary expansion distance in µm. Only for use when nucleus segmentation provided as input. Default-5 (accepted range 0 - 100) + - - dapi_filter: + type: integer + description: Minimum intensity in photoelectrons to filter nuclei default-100 range of values is 0 to 99th percentile of image stack or 1000, whichever is larger + - - boundary_stain: + type: string + description: Specify the name of the boundary stain to use or disable possible options are default-ATP1A1/CD45/E-Cadherin or disable + - - interior_stain: + type: string + description: Specify the name of the interior stain to use or disable possible options are default-18S or disable output: - outs: - - meta: - type: file - description: Files containing the outputs of Cell Ranger, see official 10X Genomics documentation for a complete list - pattern: "${meta.id}/outs/*" - - "**/outs/**": - type: file - description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list of outputs - pattern: "${meta.id}/outs/*" + - meta: + type: file + description: Files containing the outputs of Cell Ranger, see official 10X Genomics documentation for a complete list + pattern: "${meta.id}/outs/*" + - "**/outs/**": + type: file + description: Files containing the outputs of xenium ranger, see official 10X Genomics documentation for a complete list of outputs + pattern: "${meta.id}/outs/*" - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@khersameesh24" maintainers: diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index 0ec68ef6b00..238123aaf00 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -44,12 +44,14 @@ nextflow_process { process.out.versions, process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', + 'experiment.xenium', 'cells.csv.gz', 'cells.parquet', 'cells.zarr.zip', 'transcripts.parquet', 'transcripts.zarr.zip', 'analysis.zarr.zip', + 'cell_feature_matrix.zarr.zip' ]} ).match() }, @@ -60,6 +62,7 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() } ) } } diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap index 51a44b9b0ff..5f62948d241 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap @@ -5,7 +5,7 @@ "0": [ [ { - "id": "test_run" + "id": "test_xeniumranger_resegment" }, "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -16,7 +16,7 @@ "outs": [ [ { - "id": "test_run" + "id": "test_xeniumranger_resegment" }, "fake_file.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -30,7 +30,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:58:15.266114" + "timestamp": "2024-10-22T20:24:47.517833" }, "xeniumranger resegment": { "content": [ @@ -67,11 +67,9 @@ "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,68cfcd0624bd9305f08584f7dde5e9d2", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,0fda66bbd54f616aa4b8f1d5290b311f", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "metrics_summary.csv:md5,9f1269bc5f34b000945fc2070c4f1fb1", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", @@ -84,6 +82,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T15:58:01.632344" + "timestamp": "2024-10-23T19:29:12.512187" } } \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/resegment/tests/tags.yml b/modules/nf-core/xeniumranger/resegment/tests/tags.yml index e69de29bb2d..99f47c82ae9 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/tags.yml +++ b/modules/nf-core/xeniumranger/resegment/tests/tags.yml @@ -0,0 +1,2 @@ +xeniumranger/resegment: + - "modules/nf-core/xeniumranger/resegment/**" From 28fbeb3fe0f034c44d35ad163a6769a40e8aa7c7 Mon Sep 17 00:00:00 2001 From: tobiaspk Date: Thu, 24 Oct 2024 16:03:08 -0400 Subject: [PATCH 18/24] Add import-segmentation tests --- .../import-segmentation/tests/main.nf.test | 155 +++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index be37a27af47..42c74798fcd 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -1,3 +1,5 @@ +// #input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] + nextflow_process { name "Test Process XENIUMRANGER_IMPORT_SEGMENTATION" @@ -16,12 +18,163 @@ nextflow_process { script "modules/nf-core/unzip/main.nf" process { """ - input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] + input[0] = [[], file('/data/sail/projects/tools/modules/testdata/tiny.zip', checkIfExists: true)] """ } } } + test("xeniumranger import-segmentation nuclei npy") { + when { + process { + """ + input[0] = [id: "test_xeniumranger_import-segmentation"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = 0 + input[3] = [] + input[4] = UNZIP.out.unzipped_archive.map { it[1] } + "/segmentations/nuclei.npy" + input[5] = [] + input[6] = [] + input[7] = [] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', + 'metrics_summary.csv', + 'cell_boundaries.csv.gz', + 'cell_boundaries.parquet', + 'nucleus_boundaries.csv.gz', + 'nucleus_boundaries.parquet', + 'cells.csv.gz', + 'cells.parquet', + 'cells.zarr.zip', + 'transcripts.parquet', + 'transcripts.zarr.zip' + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + ) + } + } + + + test("xeniumranger import-segmentation nuclei tif") { + when { + process { + """ + input[0] = [id: "test_xeniumranger_import-segmentation"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = 0 + input[3] = [] + input[4] = UNZIP.out.unzipped_archive.map { it[1] } + "/segmentations/nuclei.npy" + input[5] = [] + input[6] = [] + input[7] = [] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', + 'metrics_summary.csv', + 'cell_boundaries.csv.gz', + 'cell_boundaries.parquet', + 'nucleus_boundaries.csv.gz', + 'nucleus_boundaries.parquet', + 'cells.csv.gz', + 'cells.parquet', + 'cells.zarr.zip', + 'transcripts.parquet', + 'transcripts.zarr.zip' + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + ) + } + } + + test("xeniumranger import-segmentation segmentation csv") { + when { + process { + """ + input[0] = [id: "test_xeniumranger_import-segmentation"] + input[1] = UNZIP.out.unzipped_archive.map { it[1] } + input[2] = 0 + input[3] = UNZIP.out.unzipped_archive.map { it[1] } + "/segmentations/imagealignment.csv" + input[4] = [] + input[5] = [] + input[6] = UNZIP.out.unzipped_archive.map { it[1] } + "/segmentations/segmentation.csv" + input[7] = UNZIP.out.unzipped_archive.map { it[1] } + "/segmentations/segmentation_polygons.json" + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.versions, + process.out.outs.get(0).get(1).findAll { file(it).name !in [ + 'analysis_summary.html', + 'metrics_summary.csv', + 'cell_boundaries.csv.gz', + 'cell_boundaries.parquet', + 'nucleus_boundaries.csv.gz', + 'nucleus_boundaries.parquet', + 'cells.csv.gz', + 'cells.parquet', + 'cells.zarr.zip', + 'transcripts.parquet', + 'transcripts.zarr.zip' + ]} + ).match() + }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + ) + } + } + test("xeniumranger import-segmentation") { when { process { From e44b6b58a1533d3634242e826266b35008783e62 Mon Sep 17 00:00:00 2001 From: tobiaspk Date: Thu, 24 Oct 2024 16:03:36 -0400 Subject: [PATCH 19/24] Rename viz_polygon parameter --- modules/nf-core/xeniumranger/import-segmentation/main.nf | 7 ++++--- modules/nf-core/xeniumranger/import-segmentation/meta.yml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/main.nf b/modules/nf-core/xeniumranger/import-segmentation/main.nf index 8457632b07b..f1f96999eb3 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/main.nf +++ b/modules/nf-core/xeniumranger/import-segmentation/main.nf @@ -12,7 +12,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { path(nuclei) path(cells) path(transcript_assignment) - path(cell_boundary_polygons) + path(viz_polygons) output: tuple val(meta), path("**/outs/**"), emit: outs @@ -32,12 +32,13 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { // image based segmentation options def expansion_distance = expansion_distance ? "--expansion-distance=\"${expansion_distance}\"": "" // expansion distance (default - 5, range - 0 - 100) def coordinate_transform = coordinate_transform ? "--coordinate-transform=\"${coordinate_transform}\"": "" + def nuclei_detection = nuclei ? "--nuclei=\"${nuclei}\"": "" def cells = cells ? "--cells=\"${cells}\"": "" // transcript based segmentation def transcript_assignment = transcript_assignment ? "--transcript-assignment=\"${transcript_assignment}\"": "" - def cell_boundary_polygons = cell_boundary_polygons ? "--viz-polygons=\"${cell_boundary_polygons}\"":"" + def viz_polygons = viz_polygons ? "--viz-polygons=\"${viz_polygons}\"":"" // shared argument def units = coordinate_transform ? "--units=microns": "--units=pixels" @@ -53,7 +54,7 @@ process XENIUMRANGER_IMPORT_SEGMENTATION { ${cells} \\ ${expansion_distance} \\ ${transcript_assignment} \\ - ${cell_boundary_polygons} \\ + ${viz_polygons} \\ ${units} \\ ${args} diff --git a/modules/nf-core/xeniumranger/import-segmentation/meta.yml b/modules/nf-core/xeniumranger/import-segmentation/meta.yml index 43c193c91a7..858144d94c2 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/meta.yml +++ b/modules/nf-core/xeniumranger/import-segmentation/meta.yml @@ -57,7 +57,7 @@ input: type: file description: | Transcript CSV with cell assignment from Baysor v0.6. Error if --cells or --nuclei arguments are used. - - - cell_boundary_polygons: + - - viz_polygons: type: file description: | Cell boundary polygons (GeoJSON) for visualization from Baysor v0.6. Required if --transcript-assignment argument used. Error if --cells or --nuclei arguments used. From 4967ce034771b3954c7d9d6da0ea050dd24d0de1 Mon Sep 17 00:00:00 2001 From: tobiaspk Date: Thu, 24 Oct 2024 16:11:21 -0400 Subject: [PATCH 20/24] Fix testdata source --- .../xeniumranger/import-segmentation/tests/main.nf.test | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index 42c74798fcd..5d38f725a7f 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -1,5 +1,3 @@ -// #input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] - nextflow_process { name "Test Process XENIUMRANGER_IMPORT_SEGMENTATION" @@ -18,7 +16,7 @@ nextflow_process { script "modules/nf-core/unzip/main.nf" process { """ - input[0] = [[], file('/data/sail/projects/tools/modules/testdata/tiny.zip', checkIfExists: true)] + input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)] """ } } From c09464edfd0890cbe31aec28bc87be062cdab9d2 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Mon, 28 Oct 2024 14:11:36 +0100 Subject: [PATCH 21/24] conda fix for ci workflow, test with resegment --- .github/workflows/test.yml | 8 +++ .../xeniumranger/resegment/tests/main.nf.test | 16 ------ .../resegment/tests/main.nf.test.snap | 54 +------------------ 3 files changed, 9 insertions(+), 69 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94b90449803..efacec47cb4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -648,6 +648,14 @@ jobs: path: subworkflows/nf-core/fastq_align_bamcmp_bwa - profile: conda path: subworkflows/nf-core/fastq_align_bwa + - profile: conda + path: modules/nf-core/xeniumranger/relabel + - profile: conda + path: modules/nf-core/xeniumranger/rename + - profile: conda + path: modules/nf-core/xeniumranger/resegment + - profile: conda + path: modules/nf-core/xeniumranger/import-segmentation env: NXF_ANSI_LOG: false NFTEST_VER: "0.9.0" diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test index 238123aaf00..faefce959df 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test @@ -39,22 +39,6 @@ nextflow_process { assertAll( { assert process.success }, { assert process.out.outs != null }, - { - assert snapshot( - process.out.versions, - process.out.outs.get(0).get(1).findAll { file(it).name !in [ - 'analysis_summary.html', - 'experiment.xenium', - 'cells.csv.gz', - 'cells.parquet', - 'cells.zarr.zip', - 'transcripts.parquet', - 'transcripts.zarr.zip', - 'analysis.zarr.zip', - 'cell_feature_matrix.zarr.zip' - ]} - ).match() - }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, diff --git a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap index 5f62948d241..fa8b9183fbc 100644 --- a/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/resegment/tests/main.nf.test.snap @@ -30,58 +30,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-22T20:24:47.517833" - }, - "xeniumranger resegment": { - "content": [ - [ - "versions.yml:md5,4671141281357e0ce26d9cb35fed23a8" - ], - [ - "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", - "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", - "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", - "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", - "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", - "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", - "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", - "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", - "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", - "clusters.csv:md5,12656931988f612717909b9c41ba56f5", - "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", - "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", - "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", - "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", - "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", - "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", - "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", - "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", - "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", - "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", - "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", - "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", - "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", - "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", - "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", - "projection.csv:md5,a69578a8549513482d66940b62532670", - "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", - "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", - "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", - "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", - "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", - "metrics_summary.csv:md5,9f1269bc5f34b000945fc2070c4f1fb1", - "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", - "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", - "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", - "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e" - ] - ], - "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" - }, - "timestamp": "2024-10-23T19:29:12.512187" + "timestamp": "2024-10-28T14:02:23.13186" } } \ No newline at end of file From 72e2c4b06a4c05c434f36f0b35cdac30e0256b52 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Tue, 29 Oct 2024 20:28:15 +0100 Subject: [PATCH 22/24] fix for some snapshots, added newer segmentation tests --- .../tests/main.nf.test.snap | 150 ++++++++++++++++++ .../xeniumranger/relabel/tests/main.nf.test | 18 ++- .../relabel/tests/main.nf.test.snap | 17 +- 3 files changed, 167 insertions(+), 18 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap index ff976139739..5d1f0914f3c 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap @@ -53,6 +53,106 @@ }, "timestamp": "2024-10-23T23:04:54.909612" }, + "xeniumranger import-segmentation nuclei npy": { + "content": [ + [ + "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" + ], + [ + "analysis.zarr.zip:md5,ed324c1eecee31e87660909d532bc788", + "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", + "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", + "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", + "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", + "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", + "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", + "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", + "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", + "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", + "clusters.csv:md5,12656931988f612717909b9c41ba56f5", + "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", + "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", + "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", + "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", + "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", + "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", + "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", + "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", + "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", + "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", + "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", + "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", + "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", + "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", + "projection.csv:md5,a69578a8549513482d66940b62532670", + "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", + "cell_feature_matrix.zarr.zip:md5,d816be002025c3977ea9e27fa8ee67dd", + "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", + "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", + "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", + "experiment.xenium:md5,46a106d37e13571e8cf4eb28131feadb", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-29T15:04:11.416299" + }, + "xeniumranger import-segmentation segmentation csv": { + "content": [ + [ + "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" + ], + [ + "analysis.zarr.zip:md5,18983e26cc1cb59b54ec35303f91a9da", + "clusters.csv:md5,f70de65852e7bb1bbd4e85ebd73c444e", + "clusters.csv:md5,722e5776f14c66d1439a906d2dfd782c", + "clusters.csv:md5,ad569cf626cb81c3dceec703b0bdcea2", + "clusters.csv:md5,721a0e7c24df44fad267700eccd7824a", + "clusters.csv:md5,b6661fc744a7f0693c2266c5ca817874", + "clusters.csv:md5,12a7f349fc7f5b8842fb29db88c582d7", + "clusters.csv:md5,2b7763cc6f03c2edb54fbcd0da5065b1", + "clusters.csv:md5,e5c7d86c11df05486404dfcd65e6db23", + "clusters.csv:md5,98ea10c79df708321eb7b29938eab280", + "clusters.csv:md5,d90b37aa721ae8640174f51af938dd41", + "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", + "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", + "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", + "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", + "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", + "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", + "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", + "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", + "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", + "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", + "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", + "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", + "projection.csv:md5,1f0778860f5a0036b2fca7dbafb8328d", + "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", + "projection.csv:md5,e826321c62b914162a1cebcbf616f5fa", + "cell_feature_matrix.h5:md5,5d74ea595561e0300b6c3e5ec8d06fff", + "cell_feature_matrix.zarr.zip:md5,6db1deed7929aca03efe2492dbe8bc88", + "barcodes.tsv.gz:md5,97496a9b448d9380cff0575b8e7a6f57", + "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", + "matrix.mtx.gz:md5,f93ed82a2a74c154392fc6237642f1d2", + "experiment.xenium:md5,19801ac341620226e42dfa885fe059d5", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-29T15:18:15.5267" + }, "xeniumranger import-segmentation stub": { "content": [ { @@ -85,5 +185,55 @@ "nextflow": "24.04.4" }, "timestamp": "2024-10-22T20:05:05.394111" + }, + "xeniumranger import-segmentation nuclei tif": { + "content": [ + [ + "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" + ], + [ + "analysis.zarr.zip:md5,978244a324238af8e3113c507bc52fab", + "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", + "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", + "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", + "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", + "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", + "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", + "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", + "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", + "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", + "clusters.csv:md5,12656931988f612717909b9c41ba56f5", + "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", + "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", + "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", + "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", + "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", + "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", + "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", + "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", + "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", + "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", + "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", + "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", + "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", + "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", + "projection.csv:md5,a69578a8549513482d66940b62532670", + "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", + "cell_feature_matrix.zarr.zip:md5,77de6d31d3d1b0f42bd037a6a9bbbeea", + "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", + "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", + "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", + "experiment.xenium:md5,ae76eb007f45bc08e58687841c367a44", + "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", + "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-29T15:12:28.743916" } } \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index 080a5afe584..e2c70088fd4 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -44,13 +44,27 @@ nextflow_process { "experiment.xenium", "transcripts.zarr.zip", "analysis_summary.html", - "cell_feature_matrix.zarr.zip" + "cell_feature_matrix.zarr.zip", + "differential_expression.csv", + "components.csv", + "projection.csv", + "variance.csv", + "metrics_summary.csv" ]} ).match() }, { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.h5' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'differential_expression.csv' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + ) } } diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap index e6b15659df6..51100f1f6c5 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap @@ -15,22 +15,8 @@ "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", "clusters.csv:md5,12656931988f612717909b9c41ba56f5", - "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", - "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", - "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", - "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", - "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", - "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", - "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", - "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", - "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", - "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", - "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", - "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", - "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", - "projection.csv:md5,a69578a8549513482d66940b62532670", "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", @@ -41,7 +27,6 @@ "cells.parquet:md5,9b30b35ab961d2d243a1426e8dc980fe", "cells.zarr.zip:md5,556e47d5b14150239b10b2f801defa2b", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", - "metrics_summary.csv:md5,4386b2545e2d2fb5bcc407b10ed36802", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", @@ -53,7 +38,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-23T17:52:18.112349" + "timestamp": "2024-10-29T14:48:49.935723" }, "xeniumranger relabel stub": { "content": [ From b4bb59a0e89ed8b71d84cd7051f897da2dacd9ca Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Tue, 29 Oct 2024 22:01:51 +0100 Subject: [PATCH 23/24] snapshot fix for xenium modules - import-segmentation, relabel --- .../import-segmentation/tests/main.nf.test | 72 ++++++++-- .../tests/main.nf.test.snap | 134 +++--------------- .../xeniumranger/relabel/tests/main.nf.test | 4 +- .../relabel/tests/main.nf.test.snap | 12 +- 4 files changed, 79 insertions(+), 143 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index 9fefd566b54..24adc933464 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -53,7 +53,12 @@ nextflow_process { 'cells.parquet', 'cells.zarr.zip', 'transcripts.parquet', - 'transcripts.zarr.zip' + 'transcripts.zarr.zip', + 'clusters.csv', + 'differential_expression.csv', + 'components.csv', + 'projection.csv', + 'variance.csv' ]} ).match() }, @@ -67,7 +72,11 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'clusters.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'differential_expression.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, ) } } @@ -104,7 +113,12 @@ nextflow_process { 'cells.parquet', 'cells.zarr.zip', 'transcripts.parquet', - 'transcripts.zarr.zip' + 'transcripts.zarr.zip', + 'clusters.csv', + 'differential_expression.csv', + 'components.csv', + 'projection.csv', + 'variance.csv' ]} ).match() }, @@ -118,7 +132,11 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'clusters.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'differential_expression.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, ) } } @@ -154,7 +172,12 @@ nextflow_process { 'cells.parquet', 'cells.zarr.zip', 'transcripts.parquet', - 'transcripts.zarr.zip' + 'transcripts.zarr.zip', + 'clusters.csv', + 'differential_expression.csv', + 'components.csv', + 'projection.csv', + 'variance.csv' ]} ).match() }, @@ -168,7 +191,11 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'clusters.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'differential_expression.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, ) } } @@ -195,22 +222,39 @@ nextflow_process { process.out.versions, process.out.outs.get(0).get(1).findAll { file(it).name !in [ 'analysis_summary.html', - 'experiment.xenium', 'metrics_summary.csv', + 'cell_boundaries.csv.gz', + 'cell_boundaries.parquet', + 'nucleus_boundaries.csv.gz', + 'nucleus_boundaries.parquet', + 'cells.csv.gz', + 'cells.parquet', 'cells.zarr.zip', - 'analysis.zarr.zip', - 'cell_feature_matrix.zarr.zip', - 'transcripts.zarr.zip' + 'transcripts.parquet', + 'transcripts.zarr.zip', + 'clusters.csv', + 'differential_expression.csv', + 'components.csv', + 'projection.csv', + 'variance.csv' ]} ).match() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis_summary.html' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'nucleus_boundaries.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.csv.gz' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.parquet' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cells.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, - { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'transcripts.parquet' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'clusters.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'differential_expression.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, ) } } diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap index 5d1f0914f3c..58d3179a013 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap @@ -5,53 +5,25 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", - "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", - "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", - "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", - "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", - "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", - "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", - "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", - "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", - "clusters.csv:md5,12656931988f612717909b9c41ba56f5", - "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", - "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", - "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", - "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", - "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", - "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", - "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", - "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", - "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", - "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", - "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "analysis.zarr.zip:md5,9abe2ae4a16b19dcb611ead07d88bcc1", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", - "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", - "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", - "projection.csv:md5,a69578a8549513482d66940b62532670", - "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", - "cell_boundaries.parquet:md5,e55d6a7fbec336103994baad8c8e4a9a", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", + "cell_feature_matrix.zarr.zip:md5,ba2f1a27a878c15125f41e8c14749b7b", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "cells.csv.gz:md5,3cef2d7cc8cfba1d47bdb7c65c3d5d5f", - "cells.parquet:md5,9b30b35ab961d2d243a1426e8dc980fe", + "experiment.xenium:md5,0043cfce849ff40087421aca2df6142a", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", - "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98", - "nucleus_boundaries.csv.gz:md5,e417b6e293298870956d42c7106cbd0c", - "nucleus_boundaries.parquet:md5,bacbfc3c2e956d899e1d8ccba5dd7c5e", - "transcripts.parquet:md5,c0f40d5c61b87404bc9efb84ff0563a8" + "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" ] ], "meta": { "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-23T23:04:54.909612" + "timestamp": "2024-10-29T21:54:38.744837" }, "xeniumranger import-segmentation nuclei npy": { "content": [ @@ -59,39 +31,15 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,ed324c1eecee31e87660909d532bc788", - "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", - "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", - "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", - "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", - "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", - "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", - "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", - "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", - "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", - "clusters.csv:md5,12656931988f612717909b9c41ba56f5", - "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", - "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", - "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", - "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", - "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", - "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", - "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", - "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", - "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", - "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", - "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "analysis.zarr.zip:md5,cfa093d4e1747c5759c9e8901141f528", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", - "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", - "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", - "projection.csv:md5,a69578a8549513482d66940b62532670", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,d816be002025c3977ea9e27fa8ee67dd", + "cell_feature_matrix.zarr.zip:md5,c8f3c8d1c9ad986719baf004e21f5383", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,46a106d37e13571e8cf4eb28131feadb", + "experiment.xenium:md5,4d923a63dfb2546015c634b8a999a866", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -101,7 +49,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T15:04:11.416299" + "timestamp": "2024-10-29T21:31:22.857543" }, "xeniumranger import-segmentation segmentation csv": { "content": [ @@ -109,39 +57,15 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,18983e26cc1cb59b54ec35303f91a9da", - "clusters.csv:md5,f70de65852e7bb1bbd4e85ebd73c444e", - "clusters.csv:md5,722e5776f14c66d1439a906d2dfd782c", - "clusters.csv:md5,ad569cf626cb81c3dceec703b0bdcea2", - "clusters.csv:md5,721a0e7c24df44fad267700eccd7824a", - "clusters.csv:md5,b6661fc744a7f0693c2266c5ca817874", - "clusters.csv:md5,12a7f349fc7f5b8842fb29db88c582d7", - "clusters.csv:md5,2b7763cc6f03c2edb54fbcd0da5065b1", - "clusters.csv:md5,e5c7d86c11df05486404dfcd65e6db23", - "clusters.csv:md5,98ea10c79df708321eb7b29938eab280", - "clusters.csv:md5,d90b37aa721ae8640174f51af938dd41", - "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", - "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", - "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", - "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", - "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", - "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", - "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", - "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", - "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", - "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", - "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "analysis.zarr.zip:md5,4b40b23fd833ff34c451094af96346e5", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", - "projection.csv:md5,1f0778860f5a0036b2fca7dbafb8328d", - "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", - "projection.csv:md5,e826321c62b914162a1cebcbf616f5fa", "cell_feature_matrix.h5:md5,5d74ea595561e0300b6c3e5ec8d06fff", - "cell_feature_matrix.zarr.zip:md5,6db1deed7929aca03efe2492dbe8bc88", + "cell_feature_matrix.zarr.zip:md5,0795648b0bb15ffa846d2bafa847dcfc", "barcodes.tsv.gz:md5,97496a9b448d9380cff0575b8e7a6f57", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,f93ed82a2a74c154392fc6237642f1d2", - "experiment.xenium:md5,19801ac341620226e42dfa885fe059d5", + "experiment.xenium:md5,2a6b216730b6bd5180515b3252980e39", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -151,7 +75,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T15:18:15.5267" + "timestamp": "2024-10-29T21:45:41.668014" }, "xeniumranger import-segmentation stub": { "content": [ @@ -192,39 +116,15 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,978244a324238af8e3113c507bc52fab", - "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", - "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", - "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", - "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", - "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", - "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", - "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", - "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", - "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", - "clusters.csv:md5,12656931988f612717909b9c41ba56f5", - "differential_expression.csv:md5,7c66ba72a51ca562e8a47f3ef0acfd2d", - "differential_expression.csv:md5,e10a431911c1d9a7d5a231d0837153a3", - "differential_expression.csv:md5,897666356892864b17c8d3881b3471cb", - "differential_expression.csv:md5,083df9f6b72d6101a8f318034ed725f2", - "differential_expression.csv:md5,d2f8ffc1bd1141361f3e839997bd58b4", - "differential_expression.csv:md5,d0d62620461c445eb2abccdbf9aedf26", - "differential_expression.csv:md5,3c0f1228921219cd8b16c175ac287f7f", - "differential_expression.csv:md5,1368d8e4c302c435ba794ccb7e398952", - "differential_expression.csv:md5,5d128e956c36d0e79cf34a8944e11e0b", - "differential_expression.csv:md5,084a2e6a4360d5e663df624f6ef732ab", - "components.csv:md5,0c53cf8c027928fd2a4999ef7bfc8acc", + "analysis.zarr.zip:md5,658edea9fba50c928b039b872cf18ed3", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", - "projection.csv:md5,930a9e650f3164540ae251a939e4adc8", - "variance.csv:md5,7d803a2c24f49b699f73728226ee0451", - "projection.csv:md5,a69578a8549513482d66940b62532670", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,77de6d31d3d1b0f42bd037a6a9bbbeea", + "cell_feature_matrix.zarr.zip:md5,f4f45065c51aec5a6b06b29de8cea46b", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,ae76eb007f45bc08e58687841c367a44", + "experiment.xenium:md5,07a740c5f4a7b79657b2fb54223c6b12", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -234,6 +134,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T15:12:28.743916" + "timestamp": "2024-10-29T21:39:47.978741" } } \ No newline at end of file diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test index e2c70088fd4..4967c1c7fd8 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test @@ -49,7 +49,8 @@ nextflow_process { "components.csv", "projection.csv", "variance.csv", - "metrics_summary.csv" + "metrics_summary.csv", + "clusters.csv" ]} ).match() }, @@ -64,6 +65,7 @@ nextflow_process { { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'metrics_summary.csv' }).exists() }, + { assert path(process.out.outs.get(0).get(1).find { file(it).name == 'clusters.csv' }).exists() }, ) } diff --git a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap index 51100f1f6c5..7c70cfc28fa 100644 --- a/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/relabel/tests/main.nf.test.snap @@ -5,16 +5,6 @@ "versions.yml:md5,ab2584177544560d5a9e9c36f7d24354" ], [ - "clusters.csv:md5,dc81c4f477e1a80b693818f7bfd3d8bb", - "clusters.csv:md5,7acdd6883a131ab93188ddbae46a876b", - "clusters.csv:md5,c50cc9ff364548abbf350d4855184fd2", - "clusters.csv:md5,e3baf175f56e18c414b77ffea0e3f68e", - "clusters.csv:md5,431fbab57e5bce8e75487b1a23a20a04", - "clusters.csv:md5,26c51a9ffb3747c15feef9709b5053cc", - "clusters.csv:md5,217d240dd587eec8814770bb31db8b95", - "clusters.csv:md5,701edc649ec0f894154bfc1cc8c4c3e4", - "clusters.csv:md5,d6c183c0491cdba01a91a77fb826a2f7", - "clusters.csv:md5,12656931988f612717909b9c41ba56f5", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", "cell_boundaries.csv.gz:md5,8b4f2aa455a6fb14b2669a42db32ea7e", @@ -38,7 +28,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T14:48:49.935723" + "timestamp": "2024-10-29T21:06:09.082129" }, "xeniumranger relabel stub": { "content": [ From 9352e673047f0dcc56fc80177d925fcd7502c8e4 Mon Sep 17 00:00:00 2001 From: khersameesh24 Date: Wed, 30 Oct 2024 00:19:37 +0100 Subject: [PATCH 24/24] minor changes for snapshots --- .../import-segmentation/tests/main.nf.test | 32 ++++++++++++++++--- .../tests/main.nf.test.snap | 20 +++--------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test index 24adc933464..8bfed862c5c 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test @@ -58,7 +58,10 @@ nextflow_process { 'differential_expression.csv', 'components.csv', 'projection.csv', - 'variance.csv' + 'variance.csv', + 'analysis.zarr.zip', + 'experiment.xenium', + 'cell_feature_matrix.zarr.zip' ]} ).match() }, @@ -77,6 +80,9 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, ) } } @@ -118,7 +124,10 @@ nextflow_process { 'differential_expression.csv', 'components.csv', 'projection.csv', - 'variance.csv' + 'variance.csv', + 'analysis.zarr.zip', + 'experiment.xenium', + 'cell_feature_matrix.zarr.zip' ]} ).match() }, @@ -137,6 +146,9 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, ) } } @@ -177,7 +189,10 @@ nextflow_process { 'differential_expression.csv', 'components.csv', 'projection.csv', - 'variance.csv' + 'variance.csv', + 'analysis.zarr.zip', + 'experiment.xenium', + 'cell_feature_matrix.zarr.zip' ]} ).match() }, @@ -196,6 +211,9 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, ) } } @@ -236,7 +254,10 @@ nextflow_process { 'differential_expression.csv', 'components.csv', 'projection.csv', - 'variance.csv' + 'variance.csv', + 'analysis.zarr.zip', + 'experiment.xenium', + 'cell_feature_matrix.zarr.zip' ]} ).match() }, @@ -255,6 +276,9 @@ nextflow_process { { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'components.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'projection.csv' }).exists() }, { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'variance.csv' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'analysis.zarr.zip' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'experiment.xenium' }).exists() }, + { assert file(process.out.outs.get(0).get(1).find { file(it).name == 'cell_feature_matrix.zarr.zip' }).exists() }, ) } } diff --git a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap index 58d3179a013..63ae8c5eacc 100644 --- a/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap +++ b/modules/nf-core/xeniumranger/import-segmentation/tests/main.nf.test.snap @@ -5,15 +5,12 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,9abe2ae4a16b19dcb611ead07d88bcc1", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,ba2f1a27a878c15125f41e8c14749b7b", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,0043cfce849ff40087421aca2df6142a", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -23,7 +20,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T21:54:38.744837" + "timestamp": "2024-10-30T00:13:13.575888" }, "xeniumranger import-segmentation nuclei npy": { "content": [ @@ -31,15 +28,12 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,cfa093d4e1747c5759c9e8901141f528", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,c8f3c8d1c9ad986719baf004e21f5383", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,4d923a63dfb2546015c634b8a999a866", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -49,7 +43,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T21:31:22.857543" + "timestamp": "2024-10-29T23:03:26.726334" }, "xeniumranger import-segmentation segmentation csv": { "content": [ @@ -57,15 +51,12 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,4b40b23fd833ff34c451094af96346e5", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", "cell_feature_matrix.h5:md5,5d74ea595561e0300b6c3e5ec8d06fff", - "cell_feature_matrix.zarr.zip:md5,0795648b0bb15ffa846d2bafa847dcfc", "barcodes.tsv.gz:md5,97496a9b448d9380cff0575b8e7a6f57", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,f93ed82a2a74c154392fc6237642f1d2", - "experiment.xenium:md5,2a6b216730b6bd5180515b3252980e39", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -75,7 +66,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T21:45:41.668014" + "timestamp": "2024-10-29T23:22:58.158857" }, "xeniumranger import-segmentation stub": { "content": [ @@ -116,15 +107,12 @@ "versions.yml:md5,d76e870d71abf94ed9ae972a08b83f63" ], [ - "analysis.zarr.zip:md5,658edea9fba50c928b039b872cf18ed3", "dispersion.csv:md5,e8b1abb880ece8fb730ce34a15f958b4", "features_selected.csv:md5,c5e32d69f001f938ed316d2108a21e00", "cell_feature_matrix.h5:md5,96cb400f1b1dd6f8796daea0ad5c74e6", - "cell_feature_matrix.zarr.zip:md5,f4f45065c51aec5a6b06b29de8cea46b", "barcodes.tsv.gz:md5,04ea06796d6b28517c288904ca043582", "features.tsv.gz:md5,7862242129681900a9cc4086dc83b62e", "matrix.mtx.gz:md5,489f86fbd8d65d6b973bb9cc7c5a76f1", - "experiment.xenium:md5,07a740c5f4a7b79657b2fb54223c6b12", "gene_panel.json:md5,8890dd5fd90706e751554ac3fdfdedde", "morphology.ome.tif:md5,6b65fff28a38a001b8f25061737fbf9b", "morphology_focus_0000.ome.tif:md5,90e796ad634d14e62cf2ebcadf2eaf98" @@ -134,6 +122,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-10-29T21:39:47.978741" + "timestamp": "2024-10-29T23:11:37.18721" } } \ No newline at end of file