-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
120 lines (95 loc) · 4.35 KB
/
Copy pathmain.nf
File metadata and controls
120 lines (95 loc) · 4.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/env nextflow
log.info """\
==========================================================================================
split-flow - PIPELINE for Droplet-based single-cell data pre-processing
==========================================================================================
split-flow single cell analysis pipeline v1. 2024-03-24.
German Cancer Research Center (DKFZ), Heidelberg - Germany
#### README: Documentation can be found here: ####
https://github.com/RippeLab/split-flow
#### Authors ####
Ezgi Sen <ezgi.sen@dkfz.de>
Mislav Basic <mislav.basic@dkfz.de>
Simon Steiger <s.steiger@dkfz.de>
Possible Modes:
-Hashed scRNA-seq
-Multiome (scRNA + scATAC - hashed)
-CITE-seq (scRNA + surface proteins - hashes)
========================================================================================
========================================================================================
"""
/*
Worklow steps:
1. Cell Calling & Ambient Molecule Correction on cellranger-multi (CR) output
# Runs CellBender
# Gets union barcodes called as plausible cells by CR and CB
# Pysam converts the CellBender output to be Seurat-readable for downstream analysis
2. Demultiplexing - Hashing-Based
# Apply HTODemux on HTO counts using CR counts, save results as a table for barcodes
# Apply MultiSeqDemux on HTO counts using CR counts, saves results as a table for barcodes
3. Demultiplexing - SNP-based (Genotype-free approach is taken)
# cellsnp-lite + vireo using a filtered .VCF file from 1000Genomes
# souporcell using a filtered .VCF file from 1000Genomes
4. Doublet Detection
# scds [cxds_bcds_hybrid()]
# scDblFinder
# Amulet (offerred for multiome mode only)
5. Create seurat and muon objects and annotated barcodes with metaData
6. Translate Donors: Hash - SNP based donor matching
7. Visualization & Reporting
8. Guiding the exploration of the concordance across demultiplexing/doublet detecion methods
*/
nextflow.enable.dsl=2
include{ CELL_CALLING } from "${projectDir}/subworkflows/CELL_CALLING"
include{ DEMULTIPLEXING } from "${projectDir}/subworkflows/DEMULTIPLEXING"
include{ CREATE_OBJECTS } from "${projectDir}/subworkflows/CREATE_OBJECTS"
include{ VISUALIZE } from "${projectDir}/subworkflows/VISUALIZE"
workflow {
// Create a channel from a (;) separated CSV file: specified with the --pool_file
//Channel.fromPath(params.pool_file, checkIfExists: true)
//.splitCsv(header: true, sep: ";")
//.map { row ->
// meta = row.subMap(["sample","sample_no"])
// [meta, row.path_cr_raw, row.path_cr_filtered]
//}
//.set { input_channel }
Channel.fromPath(params.pool_file, checkIfExists: true)
.splitCsv(header: true, sep: ";")
.map { row ->
// Create a meta map that includes the sample and sample_no fields
meta = row.subMap(["sample","sample_no"])
// Extract the raw and filtered cellranger-multi paths as file objects
def path_cr_raw = file(row.path_cr_raw)
def path_cr_filtered = file(row.path_cr_filtered)
// Return the meta map along with the processed paths
[meta, path_cr_raw, path_cr_filtered]
}
.set { raw_input_channel }
raw_input_channel.view()
//input_channel.view()
//Choose the workflow based on the params.workflow values
if (params.workflow == "CITE-seq" || params.workflow == "Multiome" || params.workflow == "scRNA-seq") {
CELL_CALLING(raw_input_channel)
DEMULTIPLEXING(CELL_CALLING.out)
CREATE_OBJECTS(DEMULTIPLEXING.out)
VISUALIZE(CREATE_OBJECTS.out)
} else {
log.error "split-flow does not analyze this type of omic input!! Please refer to the documentation at: https://github.com/RippeLab/split-flow for more information regarding the capacities and proper application of split-flow."
exit 1
}
}
workflow.onComplete {
println ( workflow.success ? """
Pipeline execution summary
---------------------------
Completed at: ${workflow.complete}
Duration : ${workflow.duration}
Success : ${workflow.success}
workDir : ${workflow.workDir}
exit status : ${workflow.exitStatus}
""" : """
Failed: ${workflow.errorReport}
exit status : ${workflow.exitStatus}
"""
)
}