Skip to content
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

added Coreograph #49

Merged
merged 17 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ process {
]
}

withName: "COREOGRAPH" {
ext.args = '--downsampleFactor 5'
RobJY marked this conversation as resolved.
Show resolved Hide resolved
}

/*
withName: SCIMAP_MCMICRO {
containerOptions = '-e NUMBA_CACHE_DIR=/tmp'
Expand Down
12 changes: 12 additions & 0 deletions modules/nf-core/coreograph/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions modules/nf-core/coreograph/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions modules/nf-core/coreograph/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions modules/nf-core/coreograph/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ params {
input_sample = null
input_cycle = null
marker_sheet = null
tma_dearray = false
segmentation = 'mesmer'
cellpose_model = []

Expand Down
4 changes: 4 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
"enum": ["basicpy"],
"description": "input that defines type of illumination correction to be performed"
},
"tma_dearray": {
"type": "boolean",
"description": "Apply coreograph module to create separate images before segmentation"
RobJY marked this conversation as resolved.
Show resolved Hide resolved
},
"segmentation": {
"type": "string",
"pattern": "^((cellpose|mesmer)?,?)*(?<!,)$",
Expand Down
41 changes: 41 additions & 0 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -523,5 +523,46 @@ nextflow_workflow {

},

test("cycle: no illumination correction, coreograph") {

when {
params {
segmentation = "mesmer"
tma_dearray = true

}
workflow {
"""
input[0] = Channel.of(
[
[id:"TEST1", cycle_number:1, channel_count:4],
"https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/imaging/core_detection/single_core_dapi.tif",
RobJY marked this conversation as resolved.
Show resolved Hide resolved
[],
[],
],
)
input[1] = Channel.of(
[
[1,1,'DNA_6',[],[],[]],
],
)
"""
}
}

then {
assertAll (
{
assert snapshot (
path("$outputDir/registration/ashlar/TEST1.ome.tif"),
path("$outputDir/segmentation/deepcell_mesmer/mask_TEST1_1.tif"),
CsvUtils.roundAndHashCsv("$outputDir/quantification/mcquant/mesmer/1_mask_TEST1_1.csv"),
RobJY marked this conversation as resolved.
Show resolved Hide resolved
).match()
},
{ assert workflow.success }
)
}
},

]
}
12 changes: 12 additions & 0 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -452,5 +452,17 @@
"nextflow": "23.10.1"
},
"timestamp": "2024-04-22T15:59:42.197064018"
},
"cycle: no illumination correction, coreograph": {
"content": [
"TEST1.ome.tif:md5,755b8a7782f9c561bb9fd6bf5e19f798",
"mask_TEST1_1.tif:md5,525d07ef2a89a8323474ff3017737ac2",
"1_mask_TEST1_1.csv:rounded:md5,5337b79dd086f0ebd0a8ffe2149d9826"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-07-22T13:53:08.522915839"
}
}
14 changes: 13 additions & 1 deletion workflows/mcmicro.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include { BASICPY } from '../modules/nf-core/basicpy/main'
include { ASHLAR } from '../modules/nf-core/ashlar/main'
include { BACKSUB } from '../modules/nf-core/backsub/main'
include { CELLPOSE } from '../modules/nf-core/cellpose/main'
include { COREOGRAPH } from '../modules/nf-core/coreograph/main'
include { DEEPCELL_MESMER } from '../modules/nf-core/deepcell/mesmer/main'
include { MCQUANT } from '../modules/nf-core/mcquant/main'
include { SCIMAP_MCMICRO } from '../modules/nf-core/scimap/mcmicro/main'
Expand Down Expand Up @@ -88,6 +89,17 @@ workflow MCMICRO {
}
*/

// Run Coreograph
if (params.tma_dearray) {
COREOGRAPH(ASHLAR.out.tif)
COREOGRAPH.out.cores
.transpose()
RobJY marked this conversation as resolved.
Show resolved Hide resolved
.map { meta, img -> [[id: meta.id + '_' + img.toString().split('/')[-1].tokenize(".")[0]], img]}
RobJY marked this conversation as resolved.
Show resolved Hide resolved
.set { ch_segmentation_input }
} else {
ch_segmentation_input = ASHLAR.out.tif
}

// Run Segmentation

ch_masks = Channel.empty()
Expand Down Expand Up @@ -120,7 +132,7 @@ workflow MCMICRO {
}
.collectFile(name: 'markers.csv', sort: false, newLine: true)

ASHLAR.out.tif
ch_segmentation_input
.cross(ch_masks) { it[0]['id'] }
.map{ t_ashlar, t_mask -> [t_mask[0], t_ashlar[1], t_mask[1]] }
.combine(ch_mcquant_markers)
Expand Down