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

Cellbender empty droplet removal #7031

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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
30 changes: 30 additions & 0 deletions subworkflows/nf-core/cellbender_empty_droplet_removal/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// cellbender remove background and empty droplet detection and removal
//
include { CELLBENDER_REMOVEBACKGROUND } from '../../../modules/nf-core/cellbender/removebackground'
include { ANNDATA_BARCODES } from '../../../modules/nf-core/anndata/barcodes'

workflow CELLBENDER_EMPTY_DROPLET_REMOVAL {

take:
ch_unfiltered

main:
ch_versions = Channel.empty()

CELLBENDER_REMOVEBACKGROUND(ch_unfiltered)
ch_versions = ch_versions.mix(CELLBENDER_REMOVEBACKGROUND.out.versions)

ch_combined = ch_unfiltered.join(CELLBENDER_REMOVEBACKGROUND.out.barcodes)

ANNDATA_BARCODES(ch_combined)
ch_versions = ch_versions.mix(ANNDATA_BARCODES.out.versions)

ch_h5ad = ANNDATA_BARCODES.out.h5ad
chaochaowong marked this conversation as resolved.
Show resolved Hide resolved

emit:
h5ad = ch_h5ad
chaochaowong marked this conversation as resolved.
Show resolved Hide resolved

chaochaowong marked this conversation as resolved.
Show resolved Hide resolved
versions = ch_versions
}

35 changes: 35 additions & 0 deletions subworkflows/nf-core/cellbender_empty_droplet_removal/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "cellbender_empty_droplet_removal"
description: Use features of Cellbender to remove background noise and empty droplet
keywords:
- scdownstream
- cellbender
- anndata
components:
- cellbender/removebackground
- anndata/barcodes
input:
- ch_unfiltered:
type: file
description: |
The input channel containing the unfiltered AnnData file to process
and remove background noise and empty droplets
Structure: [ val(meta), path(h5ad) ]
pattern: "*.h5ad"
output:
- h5ad:
description: |
Background and empty droplet removed AnnData file containing cells with
barcodes exceeding 0.5 posterior cell probability determined by the
cellbender's remove-background
Structure: [ val(meta), path(h5ad) ]
pattern: "*.h5ad"
- versions:
type: file
description: |
File containing software versions
pattern: "versions.yml"
authors:
- "@nictru"
- "@chaochaowong"
maintainers:
- "@nictru"
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
nextflow_workflow {

name "Test Subworkflow CELLBENDER_EMPTY_DROPLET_REMOVAL"
script "../main.nf"
workflow "CELLBENDER_EMPTY_DROPLET_REMOVAL"

tag "subworkflows"
tag "subworkflows_nfcore"
tag "subworkflows/cellbender_empty_droplet_removal"
tag "cellbender/removebackground"
tag "anndata/barcodes"

test("test_cellbender_empty_droplet_removal") {

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test' ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/scdownstream/samples/SAMN14430799_raw_matrix_5k.h5ad", checkIfExists: true)
])
"""
}
}
then {
assertAll(
{ assert workflow.success},
{ assert snapshot(workflow.out).match()}
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"test_cellbender_empty_droplet_removal": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.h5ad:md5,63fce875b59271df44ccab6a576b4fbf"
]
],
"1": [
"versions.yml:md5,494215861200dfa70967903c538e1373",
"versions.yml:md5,f10a2756669240175ffeba278fca7229"
],
"h5ad": [
[
{
"id": "test"
},
"test.h5ad:md5,63fce875b59271df44ccab6a576b4fbf"
]
],
"versions": [
"versions.yml:md5,494215861200dfa70967903c538e1373",
"versions.yml:md5,f10a2756669240175ffeba278fca7229"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-19T09:05:51.427525038"
}
}
Loading