forked from hisplan/sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AsapSeq.wdl
168 lines (134 loc) · 5.06 KB
/
AsapSeq.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
version 1.0
import "modules/Preprocess.wdl" as Preprocess
import "modules/HtoDemuxSeurat.wdl" as HtoDemuxSeurat
import "modules/HtoDemuxKMeans.wdl" as HtoDemuxKMeans
import "modules/ReformatFastq.wdl" as ReformatFastq
import "modules/AnnData.wdl" as AnnData
workflow AsapSeq {
input {
Array[File] fastqR1
Array[File] fastqR2
Array[File] fastqR3
String conjugation = "TotalSeqA"
Boolean noReverseComplementR2 = false
Int lengthR1
Int lengthR2
String sampleName
File cellBarcodeWhitelistUri
String cellBarcodeWhiteListMethod
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
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 ReformatFastq.ReformatAsapSeqFastq {
input:
fastqR1 = fastqR1,
fastqR2 = fastqR2,
fastqR3 = fastqR3,
sampleName = sampleName,
conjugation = conjugation,
noReverseComplementR2 = noReverseComplementR2,
numCores = 4,
dockerRegistry = dockerRegistry
}
call Preprocess.Preprocess {
input:
uriFastqR1 = [ReformatAsapSeqFastq.outFastqR1],
uriFastqR2 = [ReformatAsapSeqFastq.outFastqR2],
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
}
}
call AnnData.UpdateAnnData {
input:
sampleName = sampleName,
htoClassification = HtoDemuxKMeans.outClass,
translate10XBarcodes = translate10XBarcodes,
adata = Preprocess.adata,
dockerRegistry = dockerRegistry
}
output {
File reformattedR1 = ReformatAsapSeqFastq.outFastqR1
File reformattedR2 = ReformatAsapSeqFastq.outFastqR2
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 adataRaw = Preprocess.adata
File adataFinal = UpdateAnnData.outAdata
}
}