forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add phenotyped data under imaging/downstream * Add the scimap implementation of spatialLDA * passes lint and tests * now it has real tests * Added stub tests * Prettifies * exclude scimap/spatiallda from executing conda test * This works! :D
- Loading branch information
Showing
8 changed files
with
246 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
process SCIMAP_SPATIALLDA { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
container "docker.io/miguelib/scimap:0.0.3" | ||
|
||
input: | ||
tuple val(meta), path(phenotyped) | ||
|
||
output: | ||
tuple val(meta), path("*.csv") , emit: spatial_lda_output | ||
tuple val(meta), path("*.png") , emit: composition_plot | ||
tuple val(meta), path("*.html"), emit: motif_location_plot | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
""" | ||
python /scimap/scripts/spatialLDA.py \ | ||
--input $phenotyped \ | ||
--output "${prefix}.csv" \ | ||
--neighborhood-composition-plot "${prefix}.png" \ | ||
--motif-locations-plot "${prefix}.html" \ | ||
$args | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
scimap/spatialLDA: \$(python /scimap/scripts/spatialLDA.py --version) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
""" | ||
touch "${prefix}.csv" | ||
touch "${prefix}.png" | ||
touch "${prefix}.html" | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
scimap/spatialLDA: \$(python /scimap/scripts/spatialLDA.py --version) | ||
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,52 @@ | ||
name: "scimap_spatiallda" | ||
description: SpatialLDA uses an LDA based approach for the identification of cellular neighborhoods, using cell type identities. | ||
keywords: | ||
- spatial_neighborhoods | ||
- scimap | ||
- spatial_omics | ||
tools: | ||
- "scimap": | ||
description: "Scimap is a scalable toolkit for analyzing spatial molecular data. The underlying framework is generalizable to spatial datasets mapped to XY coordinates. The package uses the anndata framework making it easy to integrate with other popular single-cell analysis toolkits. It includes preprocessing, phenotyping, visualization, clustering, spatial analysis and differential spatial testing. The Python-based implementation efficiently deals with large datasets of millions of cells." | ||
homepage: "https://scimap.xyz/" | ||
documentation: "https://scimap.xyz/tutorials/1-scimap-tutorial-getting-started/" | ||
tool_dev_url: "https://github.com/labsyspharm/scimap" | ||
doi: "10.5281/zenodo.7854095" | ||
licence: ["MIT licence"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- phenotyped: | ||
type: file | ||
description: Phenotyped CSV file, it must contain the columns, sampleID, X, Y and Phenotype. | ||
pattern: "*.{csv}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- spatial_lda_output: | ||
type: file | ||
description: File with the motifs detected from SpatialLDA | ||
pattern: "*.{csv}" | ||
- composition_plot: | ||
type: file | ||
description: Plot with the motif composition and the cell type composition of motifs. | ||
pattern: "*.{png}" | ||
- motif_location_plot: | ||
type: file | ||
description: Plot with the locations of the motifs. | ||
pattern: "*.{html}" | ||
authors: | ||
- "@migueLib" | ||
- "@chiarasch" | ||
maintainers: | ||
- "@migueLib" | ||
- "@chiarasch" |
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,55 @@ | ||
nextflow_process { | ||
|
||
name "Test Process SCIMAP_SPATIALLDA" | ||
script "../main.nf" | ||
config "./nextflow.config" | ||
process "SCIMAP_SPATIALLDA" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "scimap" | ||
tag "scimap/spatiallda" | ||
|
||
test("spatiallda - csv") { | ||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.test_data['imaging']['downstream']['phenotyped'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert process.out.spatial_lda_output }, | ||
{ assert process.out.composition_plot }, | ||
{ assert process.out.motif_location_plot }, | ||
{ assert process.out.versions }, | ||
{ assert snapshot(process.out.versions).match("versions") }, | ||
) | ||
} | ||
} | ||
test("spatiallda - stub") { | ||
options "-stub" | ||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.test_data['imaging']['downstream']['phenotyped'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() }, | ||
) | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
process { | ||
withName: "SCIMAP_SPATIALLDA" { | ||
ext.args = '--phenotype phenotype --x-coordinate X_centroid --y-coordinate Y_centroid --sample-id sampleid --radius 30 --num-motifs 10 --method radius' | ||
} | ||
} |
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,2 @@ | ||
scimap/spatiallda: | ||
- "modules/nf-core/scimap/spatiallda/**" |
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