-
Notifications
You must be signed in to change notification settings - Fork 0
/
cellbrowser-build-cellranger-arc.cwl
277 lines (248 loc) · 9.19 KB
/
cellbrowser-build-cellranger-arc.cwl
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
cwlVersion: v1.0
class: CommandLineTool
hints:
- class: DockerRequirement
dockerPull: biowardrobe2/cellbrowser:v0.0.2
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entryname: cellbrowser_gex.conf
entry: |
name = "GEX"
shortLabel="GEX"
priority = 1
geneIdType="auto"
geneLabel="Gene"
exprMatrix="exprMatrix.tsv.gz"
meta="meta.csv"
coords=[
{
"file": "tsne.coords.csv",
"shortLabel": "t-SNE"
},
{
"file": "umap.coords.csv",
"shortLabel": "UMAP"
}
]
markers=[
{
"file":"markers.tsv",
"shortLabel":"Cluster-specific genes"
}
]
enumFields = ["Barcode"]
clusterField="Cluster"
labelField="Cluster"
dataRoot="../"
- entryname: cellbrowser_atac.conf
entry: |
name = "ATAC"
shortLabel="ATAC"
priority = 1
geneIdType="auto"
geneLabel="Peak"
exprMatrix="exprMatrix.tsv.gz"
meta="meta.csv"
coords=[
{
"file": "tsne.coords.csv",
"shortLabel": "t-SNE"
},
{
"file": "umap.coords.csv",
"shortLabel": "UMAP"
},
{
"file": "lsa.coords.csv",
"shortLabel": "LSA"
}
]
markers=[
{
"file":"markers.tsv",
"shortLabel":"Cluster-specific peaks"
}
]
enumFields = ["Barcode"]
clusterField="Cluster"
labelField="Cluster"
dataRoot="../"
- entryname: cellbrowser.conf
entry: |
shortLabel="Multiome"
- entryname: desc_gex.conf
entry: |
title = "GEX"
abstract = ""
methods = ""
biorxiv_url = ""
custom = {}
- entryname: desc_atac.conf
entry: |
title = "ATAC"
abstract = ""
methods = ""
biorxiv_url = ""
custom = {}
inputs:
bash_script:
type: string?
default: |
#!/bin/bash
echo "Preparing ATAC data"
mkdir -p ./atac_input/analysis/clustering/graphclust \
./atac_input/analysis/diffexp/graphclust \
./atac_input/analysis/tsne/2_components \
./atac_input/analysis/umap/2_components \
./atac_input/analysis/lsa/2_components
cp -r $0/clustering/atac/graphclust/clusters.csv ./atac_input/analysis/clustering/graphclust/clusters.csv
cp -r $0/clustering/atac/graphclust/differential_accessibility.csv ./atac_input/analysis/diffexp/graphclust/differential_expression.csv
cp -r $0/dimensionality_reduction/atac/tsne_projection.csv ./atac_input/analysis/tsne/2_components/projection.csv
cp -r $0/dimensionality_reduction/atac/umap_projection.csv ./atac_input/analysis/umap/2_components/projection.csv
cp -r $0/dimensionality_reduction/atac/lsa_projection.csv ./atac_input/analysis/lsa/2_components/projection.csv
mkdir -p ./atac_input/filtered_feature_bc_matrix
cp -r $1/* ./atac_input/filtered_feature_bc_matrix/
echo "Importing ATAC data"
cbImportCellranger -i atac_input -o atac --name atac
cd ./atac
echo "Copying coordinates files"
cp ../atac_input/analysis/tsne/2_components/projection.csv tsne.coords.csv
cp ../atac_input/analysis/umap/2_components/projection.csv umap.coords.csv
cp ../atac_input/analysis/lsa/2_components/projection.csv lsa.coords.csv
echo "Replacing configuration files"
rm -f cellbrowser.conf desc.conf
cp ../cellbrowser_atac.conf cellbrowser.conf
cp ../desc_atac.conf desc.conf
if [[ -n $2 ]]; then
echo "Aggregation metadata file was provided. Adding initial cell identity classes"
cat $2 | grep -v "library_id" | awk '{print NR","$0}' > aggregation_metadata.csv
cat meta.csv | grep -v "Barcode" > meta_headerless.csv
echo "Barcode,Cluster,Identity" > meta.csv
awk -F, 'NR==FNR {identity[$1]=$2; next} {split($1,barcode,"-"); print $0","identity[barcode[2]]}' aggregation_metadata.csv meta_headerless.csv >> meta.csv
rm -f aggregation_metadata.csv meta_headerless.csv
fi
cd ..
echo "Preparing GEX data"
mkdir -p ./gex_input/analysis/clustering/graphclust \
./gex_input/analysis/diffexp/graphclust \
./gex_input/analysis/tsne/2_components \
./gex_input/analysis/umap/2_components
cp -r $0/clustering/gex/graphclust/clusters.csv ./gex_input/analysis/clustering/graphclust/clusters.csv
cp -r $0/clustering/gex/graphclust/differential_expression.csv ./gex_input/analysis/diffexp/graphclust/differential_expression.csv
cp -r $0/dimensionality_reduction/gex/tsne_projection.csv ./gex_input/analysis/tsne/2_components/projection.csv
cp -r $0/dimensionality_reduction/gex/umap_projection.csv ./gex_input/analysis/umap/2_components/projection.csv
mkdir -p ./gex_input/filtered_feature_bc_matrix
cp -r $1/* ./gex_input/filtered_feature_bc_matrix/
echo "Importing GEX data"
cbImportCellranger -i gex_input -o gex --name gex
cd ./gex
echo "Copying coordinates files"
cp ../gex_input/analysis/tsne/2_components/projection.csv tsne.coords.csv
cp ../gex_input/analysis/umap/2_components/projection.csv umap.coords.csv
echo "Replacing configuration files"
rm -f cellbrowser.conf desc.conf
cp ../cellbrowser_gex.conf cellbrowser.conf
cp ../desc_gex.conf desc.conf
if [[ -n $2 ]]; then
echo "Aggregation metadata file was provided. Adding initial cell identity classes"
cat $2 | grep -v "library_id" | awk '{print NR","$0}' > aggregation_metadata.csv
cat meta.csv | grep -v "Barcode" > meta_headerless.csv
echo "Barcode,Cluster,Identity" > meta.csv
awk -F, 'NR==FNR {identity[$1]=$2; next} {split($1,barcode,"-"); print $0","identity[barcode[2]]}' aggregation_metadata.csv meta_headerless.csv >> meta.csv
rm -f aggregation_metadata.csv meta_headerless.csv
fi
cd ..
echo "Building"
cbBuild -r -o html_data
echo "Cleaning up temporary files"
rm -rf gex_input atac_input atac gex
inputBinding:
position: 5
doc: |
Bash script to run cbImportCellranger and cbBuild commands
secondary_analysis_report_folder:
type: Directory
inputBinding:
position: 6
doc: |
Folder with secondary analysis results including dimensionality reduction,
cell clustering, and differential expression produced by Cellranger ARC
Count or Cellranger ARC Aggr
filtered_feature_bc_matrix_folder:
type: Directory
inputBinding:
position: 7
doc: |
Folder with filtered feature-barcode matrices containing only cellular
barcodes in MEX format produced by Cellranger ARC Count or Cellranger ARC Aggr
aggregation_metadata:
type: File?
inputBinding:
position: 8
doc: |
Cellranger aggregation CSV file. If provided, the Identity metadata
column will be added to the meta.csv
outputs:
html_data:
type: Directory
outputBinding:
glob: "html_data"
index_html_file:
type: File
outputBinding:
glob: "html_data/index.html"
stdout_log:
type: stdout
stderr_log:
type: stderr
baseCommand: ["bash", "-c"]
stdout: cbbuild_stdout.log
stderr: cbbuild_stderr.log
$namespaces:
s: http://schema.org/
$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf
label: "Cell Ranger ARC Count/Aggregate to UCSC Cell Browser"
s:name: "Cell Ranger ARC Count/Aggregate to UCSC Cell Browser"
s:alternateName: |
Exports clustering results from Cell Ranger ARC Count Chromatin Accessibility and Gene Expression or
Cell Ranger ARC Aggregate experiments into compatible with UCSC Cell Browser format
s:downloadUrl: https://raw.githubusercontent.com/Barski-lab/sc-seq-analysis/main/tools/cellbrowser-build-cellranger-arc.cwl
s:codeRepository: https://github.com/Barski-lab/sc-seq-analysis
s:license: http://www.apache.org/licenses/LICENSE-2.0
s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/
s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:[email protected]
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898
doc: |
Cell Ranger ARC Count/Aggregate to UCSC Cell Browser
Exports clustering results from Cell Ranger ARC Count
Chromatin Accessibility and Gene Expression or Cell
Ranger ARC Aggregate experiments into compatible with
UCSC Cell Browser format