-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5127 new module xenium ranger #6826
Open
khersameesh24
wants to merge
29
commits into
nf-core:master
Choose a base branch
from
khersameesh24:5127-new-module-xenium-ranger
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,430
−1
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9ec866c
Initial commit for the xeniumranger module
ae9bc52
test file correction, placeholder code for relabel
631481c
minor fix for segmentation input for xenium import-segmentation
fe10e6a
test cases for xenium modules
e2a05e2
changes in test config, minor fixes for dockerfile versioning, test s…
8294642
updated container image for xeniumranger
fee6db0
Updated xeniumranger version hence the dockerfile, added newer submod…
khersameesh24 54a02a8
Updated xeniumranger version hence the dockerfile, added newer submod…
khersameesh24 79ed3ba
testing xenium modules, tests for rename module
khersameesh24 9fff425
minor fixes for relabel
bf94049
fix for outs directory
147e3b3
minor fixes for resegment
bb1893b
tested xeniumranger modules with test data, fixed nf-test, testdata f…
f407f0d
fixed linting issues with xenium modules
9b34ee1
minor typo fix
e636fa5
minor typo fix
b2c99ad
Merge branch '5127-new-module-xenium-ranger' of https://github.com/kh…
Tobiaspk 840b977
linting fix, nf-test fix for unstable checksums
khersameesh24 9278936
Merge branch 'master' into 5127-new-module-xenium-ranger
khersameesh24 28fbeb3
Add import-segmentation tests
Tobiaspk e44b6b5
Rename viz_polygon parameter
Tobiaspk 4967ce0
Fix testdata source
Tobiaspk 7df986f
Merge branch '5127-new-module-xenium-ranger' of https://github.com/kh…
Tobiaspk c09464e
conda fix for ci workflow, test with resegment
khersameesh24 7cd6c88
Merge pull request #2 from Tobiaspk/5127-new-module-xenium-ranger
khersameesh24 72e2c4b
fix for some snapshots, added newer segmentation tests
khersameesh24 4c7b5f3
Merge branch 'master' into 5127-new-module-xenium-ranger
khersameesh24 b4bb59a
snapshot fix for xenium modules - import-segmentation, relabel
khersameesh24 9352e67
minor changes for snapshots
khersameesh24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Use a base image with the required operating system | ||
FROM ubuntu:20.04 AS builder | ||
|
||
LABEL authors="Sameesh Kher <[email protected]>" \ | ||
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/* | ||
|
||
# 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-3.0.1.tar.gz /xeniumranger-3.0.1.tar.gz | ||
|
||
# install xenium ranger | ||
RUN tar -xzvf /xeniumranger-3.0.1.tar.gz && \ | ||
rm /xeniumranger-3.0.1.tar.gz | ||
|
||
# Set environment variables | ||
# ENV PATH="xeniumranger-xenium3.0/bin:$PATH" | ||
|
||
# multistage to reduce image size | ||
FROM ubuntu:20.04 | ||
|
||
# Set environment variables | ||
ENV PATH="/xeniumranger-xenium3.0/bin:$PATH" | ||
|
||
# copy over xenium from builder | ||
COPY --from=builder /xeniumranger-xenium3.0 /xeniumranger-xenium3.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 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 [3.0.1](https://www.10xgenomics.com/support/software/xenium-ranger/downloads) in the dockerfile) | ||
|
||
3. Create and test the container: | ||
|
||
```bash | ||
docker build . -t quay.io/nf-core/xeniumranger:<VERSION> | ||
``` | ||
|
||
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:<VERSION> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
process XENIUMRANGER_IMPORT_SEGMENTATION { | ||
tag "$meta.id" | ||
label 'process_high' | ||
|
||
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(viz_polygons) | ||
|
||
output: | ||
tuple val(meta), 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 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 viz_polygons = viz_polygons ? "--viz-polygons=\"${viz_polygons}\"":"" | ||
|
||
// shared argument | ||
def units = coordinate_transform ? "--units=microns": "--units=pixels" | ||
|
||
""" | ||
xeniumranger import-segmentation \\ | ||
--id="${prefix}" \\ | ||
--xenium-bundle="${xenium_bundle}" \\ | ||
--localcores=${task.cpus} \\ | ||
--localmem=${task.memory.toGiga()} \\ | ||
${coordinate_transform} \\ | ||
${nuclei_detection} \\ | ||
${cells} \\ | ||
${expansion_distance} \\ | ||
${transcript_assignment} \\ | ||
${viz_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." | ||
} | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
mkdir -p "${prefix}/outs/" | ||
touch "${prefix}/outs/fake_file.txt" | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
xeniumranger: \$(xeniumranger -V | sed -e "s/xeniumranger-/- /g") | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
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" | ||
identifier: "" | ||
|
||
input: | ||
- - 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: 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. | ||
- - 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. | ||
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/*" | ||
- versions: | ||
- versions.yml: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@khersameesh24" | ||
maintainers: | ||
- "@khersameesh24" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep the original version. We want to use the currently stable version of prettier.