Skip to content

Commit

Permalink
Implement subworkflow for ambient RNA removal
Browse files Browse the repository at this point in the history
  • Loading branch information
nictru committed Jun 15, 2024
1 parent 74d32c9 commit 3e4abc0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
20 changes: 20 additions & 0 deletions subworkflows/local/ambient_rna_removal.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include { CELDA_DECONTX } from '../../modules/local/celda/decontx'

workflow AMBIENT_RNA_REMOVAL {
take:
ch_h5ad

main:
ch_versions = Channel.empty()

if (params.ambient_removal == 'decontx') {
CELDA_DECONTX(ch_h5ad)
ch_h5ad = CELDA_DECONTX.out.h5ad
ch_versions = CELDA_DECONTX.out.versions
}

emit:
h5ad = ch_h5ad

versions = ch_versions
}
11 changes: 4 additions & 7 deletions subworkflows/local/preprocess.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include { ADATA_READRDS } from '../../modules/local/adata/readrds
include { ADATA_READCSV } from '../../modules/local/adata/readcsv'
include { ADATA_UNIFY } from '../../modules/local/adata/unify'
include { SCANPY_PLOTQC as QC_RAW } from '../../modules/local/scanpy/plotqc'
include { CELDA_DECONTX } from '../../modules/local/celda/decontx'
include { AMBIENT_RNA_REMOVAL } from './ambient_rna_removal'
include { DOUBLET_DETECTION } from './doublet_detection'
include { SCANPY_PLOTQC as QC_FILTERED } from '../../modules/local/scanpy/plotqc'

Expand Down Expand Up @@ -42,12 +42,9 @@ workflow PREPROCESS {
ch_multiqc_files = ch_multiqc_files.mix(QC_RAW.out.multiqc_files)
ch_versions = ch_versions.mix(QC_RAW.out.versions)

// Ambient RNA removal
if (params.ambient_removal == 'decontx') {
CELDA_DECONTX(ch_h5ad)
ch_h5ad = CELDA_DECONTX.out.h5ad
ch_versions = CELDA_DECONTX.out.versions
}
AMBIENT_RNA_REMOVAL(ch_h5ad)
ch_h5ad = AMBIENT_RNA_REMOVAL.out.h5ad
ch_versions = ch_versions.mix(AMBIENT_RNA_REMOVAL.out.versions)

DOUBLET_DETECTION(ch_h5ad)
ch_h5ad = DOUBLET_DETECTION.out.h5ad
Expand Down

0 comments on commit 3e4abc0

Please sign in to comment.