forked from hisplan/sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hashtag.wdl
185 lines (149 loc) · 5.7 KB
/
Hashtag.wdl
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
version 1.0
import "modules/Preprocess.wdl" as Preprocess
import "modules/HtoDemuxSeurat.wdl" as HtoDemuxSeurat
import "modules/HtoDemuxKMeans.wdl" as HtoDemuxKMeans
import "modules/Combine.wdl" as Combine
import "modules/AnnData.wdl" as AnnData
import "modules/BasicQC.wdl" as BasicQC
workflow Hashtag {
input {
Array[File] uriFastqR1
Array[File] uriFastqR2
Int lengthR1
Int lengthR2
String sampleName
File cellBarcodeWhitelistUri
String cellBarcodeWhiteListMethod
# set to false if TotalSeq-A is used
# set to true if TotalSeq-B or C is used
Boolean translate10XBarcodes
String scRnaSeqPlatform = "10x_v3"
File hashTagList
# cellular barcode start/end positions
Int cbStartPos
Int cbEndPos
# UMI start/end positions
Int umiStartPos
Int umiEndPos
# how many bases should we trim before starting to look for hashtag sequence
Int trimPos = 0
# activate sliding window alignement
Boolean slidingWindowSearch = false
# correction
Int cbCollapsingDistance
Int umiCollapsingDistance
Int maxTagError = 2
Int numExpectedCells
File? denseCountMatrix
Boolean runSeuratDemux = false
Int demuxMode = 1
Int minCount = 0
Map[String, Int] resourceSpec
# docker-related
String dockerRegistry
}
parameter_meta {
demuxMode: { help: "1=default, 2=noisy methanol, 3=aggressively rescue from doublets" }
}
call Preprocess.Preprocess {
input:
uriFastqR1 = uriFastqR1,
uriFastqR2 = uriFastqR2,
lengthR1 = lengthR1,
lengthR2 = lengthR2,
sampleName = sampleName,
cellBarcodeWhitelistUri = cellBarcodeWhitelistUri,
cellBarcodeWhiteListMethod = cellBarcodeWhiteListMethod,
translate10XBarcodes = translate10XBarcodes,
scRnaSeqPlatform = scRnaSeqPlatform,
tagList = hashTagList,
cbStartPos = cbStartPos,
cbEndPos = cbEndPos,
umiStartPos = umiStartPos,
umiEndPos = umiEndPos,
trimPos = trimPos,
slidingWindowSearch = slidingWindowSearch,
cbCollapsingDistance = cbCollapsingDistance,
umiCollapsingDistance = umiCollapsingDistance,
maxTagError = maxTagError,
numExpectedCells = numExpectedCells,
resourceSpec = resourceSpec,
dockerRegistry = dockerRegistry
}
# HTO demux using KMeans
call HtoDemuxKMeans.HtoDemuxKMeans {
input:
umiCountFiles = Preprocess.umiCountMatrix,
minCount = minCount,
mode = demuxMode,
dockerRegistry = dockerRegistry
}
# HTO demux using Seurat
if (runSeuratDemux == true) {
call HtoDemuxSeurat.HtoDemuxSeurat {
input:
umiCountFiles = Preprocess.umiCountMatrix,
quantile = 0.99,
dockerRegistry = dockerRegistry
}
# correct false positive doublets frm Seurat output
call HtoDemuxSeurat.CorrectFalsePositiveDoublets {
input:
htoClassification = HtoDemuxSeurat.outClassCsv,
umiCountFiles = Preprocess.umiCountMatrix,
dockerRegistry = dockerRegistry
}
}
# combine count matrix with hashtag classification
# if SEQC dense count matrix is provided
if (defined(denseCountMatrix)) {
call Combine.HashedCountMatrix {
input:
denseCountMatrix = select_first([denseCountMatrix]),
htoClassification = HtoDemuxKMeans.outClass,
translate10XBarcodes = translate10XBarcodes,
dockerRegistry = dockerRegistry
}
}
call AnnData.UpdateAnnData {
input:
sampleName = sampleName,
htoClassification = HtoDemuxKMeans.outClass,
translate10XBarcodes = translate10XBarcodes,
adata = Preprocess.adata,
dockerRegistry = dockerRegistry
}
call BasicQC.BasicQC {
input:
sampleName = sampleName,
h5ad = UpdateAnnData.outAdata,
readsCount = Preprocess.readCountMatrix,
runReport = Preprocess.countReport,
templateNotebook = "inspect-hashtag-v3.ipynb",
dockerRegistry = dockerRegistry
}
output {
File fastQCR1Html = Preprocess.fastQCR1Html
File fastQCR2Html = Preprocess.fastQCR2Html
File countReport = Preprocess.countReport
Array[File] umiCountMatrix = Preprocess.umiCountMatrix
Array[File] readCountMatrix = Preprocess.readCountMatrix
File htoClassification = HtoDemuxKMeans.outClass
File? htoClassification_Suppl1 = HtoDemuxSeurat.outClassCsv
File? htoClassification_Suppl2 = HtoDemuxSeurat.outFullCsv
File? htoClassification_Suppl3 = CorrectFalsePositiveDoublets.outClass
File statsHtoDemux = HtoDemuxKMeans.outStats
File? statsHtoDemux_Suppl1 = CorrectFalsePositiveDoublets.outStats
File logHtoDemux = HtoDemuxKMeans.outLog
File? logHtoDemux_Suppl1 = CorrectFalsePositiveDoublets.outLog
File? combinedClass = HashedCountMatrix.outClass
File? combinedCountMatrix = HashedCountMatrix.outCountMatrix
File? combinedStats = HashedCountMatrix.outStats
File? combinedLog = HashedCountMatrix.outLog
File adataRaw = Preprocess.adata
File adataFinal = UpdateAnnData.outAdata
File notebookQC = BasicQC.notebook
File htmlQC = BasicQC.htmlReport
File adataQC = BasicQC.adata
}
}