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 all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Apply cellbender and anndata to h5ad for background and empty droplet removal
//
include { CELLBENDER_REMOVEBACKGROUND } from '../../../modules/nf-core/cellbender/removebackground'
include { ANNDATA_BARCODES } from '../../../modules/nf-core/anndata/barcodes'

workflow H5AD_REMOVEBACKGROUND_BARCODES_CELLBENDER_ANNDATA {

take:
ch_unfiltered // channel: [mandatory] meta, h5ad

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)

emit:
h5ad = ANNDATA_BARCODES.out.h5ad // channel: [ val(meta), path(h5ad) ]

versions = ch_versions // channel: [ path(versions.yml) ]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "h5ad_removebackground_barcodes_cellbender_anndata"
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,6 @@

process {
withName: CELLBENDER_REMOVEBACKGROUND {
ext.args = '--epochs 20'
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
nextflow_workflow {

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

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

test("h5ad - h5ad_removebackground_barcodes_cellbender_anndata") {
config './epochs.config'
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 @@
{
"h5ad - h5ad_removebackground_barcodes_cellbender_anndata": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.h5ad:md5,6c94663b900a495d3492cd0b216c9b67"
]
],
"1": [
"versions.yml:md5,3b268371ecd09ac624398c004f5e279d",
"versions.yml:md5,fc7f5fec60cfd2b10b91177571ee63e8"
],
"h5ad": [
[
{
"id": "test"
},
"test.h5ad:md5,6c94663b900a495d3492cd0b216c9b67"
]
],
"versions": [
"versions.yml:md5,3b268371ecd09ac624398c004f5e279d",
"versions.yml:md5,fc7f5fec60cfd2b10b91177571ee63e8"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-26T15:17:04.577770824"
}
}
Loading