-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_scp_data.html
688 lines (509 loc) · 28.8 KB
/
read_scp_data.html
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>Reading single-cell proteomics data</title>
<meta charset="utf-8" />
<meta name="author" content="Laurent Gatto and Christophe Vanderaa" />
<script src="read_scp_data_files/xaringanExtra-webcam-0.0.1/webcam.js"></script>
<script id="xaringanExtra-webcam-options" type="application/json">{"width":"200","height":"200","margin":"1em"}</script>
<link href="read_scp_data_files/tile-view-0.2.6/tile-view.css" rel="stylesheet" />
<script src="read_scp_data_files/tile-view-0.2.6/tile-view.js"></script>
<script src="read_scp_data_files/xaringanExtra_fit-screen-0.2.6/fit-screen.js"></script>
<link href="read_scp_data_files/xaringanExtra-extra-styles-0.2.6/xaringanExtra-extra-styles.css" rel="stylesheet" />
<link href="read_scp_data_files/panelset-0.2.6/panelset.css" rel="stylesheet" />
<script src="read_scp_data_files/panelset-0.2.6/panelset.js"></script>
<script src="read_scp_data_files/htmlwidgets-1.5.3/htmlwidgets.js"></script>
<script src="read_scp_data_files/jquery-3.5.1/jquery.min.js"></script>
<link href="read_scp_data_files/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet" />
<script src="read_scp_data_files/datatables-binding-0.18/datatables.js"></script>
<link href="read_scp_data_files/dt-core-1.10.20/css/jquery.dataTables.min.css" rel="stylesheet" />
<link href="read_scp_data_files/dt-core-1.10.20/css/jquery.dataTables.extra.css" rel="stylesheet" />
<script src="read_scp_data_files/dt-core-1.10.20/js/jquery.dataTables.min.js"></script>
<link href="read_scp_data_files/crosstalk-1.1.1/css/crosstalk.css" rel="stylesheet" />
<script src="read_scp_data_files/crosstalk-1.1.1/js/crosstalk.min.js"></script>
<link rel="stylesheet" href="xaringan-themer.css" type="text/css" />
<link rel="stylesheet" href="custom.css" type="text/css" />
</head>
<body>
<textarea id="source">
class: center, middle, inverse, title-slide
# Reading single-cell proteomics data
### Laurent Gatto and Christophe Vanderaa
### 2021/08/10
---
class: middle
name: cc-by
### Get the slides at https://bit.ly/202108SCP
These slides are available under a **creative common
[CC-BY license](http://creativecommons.org/licenses/by/4.0/)**. You are
free to share (copy and redistribute the material in any medium or
format) and adapt (remix, transform, and build upon the material) for
any purpose, even commercially
<img height="20px" alt="CC-BY" src="https://raw.githubusercontent.com/UCLouvain-CBIO/scp-teaching/main/img/cc1.jpg" />.
???
In this presentation, you will learn how to convert data tables into
`QFeatures` objects that can further be used for data processing.
I highly recommend you to watch the previous video about handling
quantitative proteomics features, if that's not already done.
The slides are available at the given link and are shared under CC-BY
license.
---
class: middle, center, inverse
# How can I convert my single-cell proteomics data to a QFeatures object?
???
So the focus point of this presentation is answering the question:
how can I convert my single-cell proteomics data to a QFeatures object?
---
class: middle
## How can I convert my single-cell proteomics data to a QFeatures object?
The `readSCP()` function converts quantified mass spectrometry data
tables to `QFeatures` objects.
<br>
<img src="./figs/read_scp_data_readSCP.svg" width="90%" style="display: block; margin: auto;" />
???
You can do that thanks to the `readSCP()` function. The function
combines an input table and a sample table into a ready-to-process
`QFeatures` object. Let me explain what those two tables correspond to.
---
class:
## Input table
.panelset[
.panel[.panel-name[Description]
.left-column[
<img src="./figs/read_scp_data_inputTable.png" width="100%" style="display: block; margin: auto;" />
]
.right-column[
Input table = output table from pre-processing software, such as
MaxQuant (*e.g.* `evidence.txt`) or ProteomeDiscoverer (*e.g.*
`PSMs.txt`).
In general, 3 types of columns:
- feature annotations: *e.g.* peptide sequence, ion charge, protein name
- quantification columns: 1 to n (depending on technology)
- acquisition data: *e.g.* file name
]
]
.panel[.panel-name[Example]
<div id="htmlwidget-6d2eab6d79b8e1596e80" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-6d2eab6d79b8e1596e80">{"x":{"filter":"none","data":[["1","2","3","4","5","6","7","8"],["ATNFLAHEK","ATNFLAHEK","SHTILLVQPTK","SHTILLVQPTK","SHTILLVQPTK","SLVIPEK","SLVIPEK","VDREQLVQK"],[9,9,11,11,11,7,7,9],[2,2,2,2,2,2,2,2],[65.781,63.787,71.884,68.633,71.946,76.204,78.087,57.329],[0.00052636,0.00058789,4.0315e-24,4.7622e-06,6.8709e-09,0.053705,0.0595,0.004872],["P29692","P29692","P84090","P84090","P84090","P62269","P62269","P61981"],[61251,58648,150350,27347,84035,44895,179560,57895],[501.71,1099.8,3705,405.9,583.09,700.23,5385.4,603.73],[3731.3,2837.7,9361,1525.2,4092.3,2283,13670,2787.9],[1643.3,494.32,0,0,530.13,1109.6,690.53,757.17],[871.84,349.26,1945.4,0,718.13,0,3653.5,862.08],[981.87,1030.5,1188.6,318.74,2204.5,675.79,3624.9,1118.8],[1200.1,0,1574,0,960.51,0,5680.8,640.1],[939.06,1214.1,2302.1,519.81,453.77,809.38,5114.5,1446.1],[1457.5,800.58,2176.1,0,1188.4,668.88,4907.3,968.49],[1329.8,807.79,1399.5,507.23,740.99,1467.5,4584,648.56],[981.83,391.38,1307.5,370.79,0,901.38,4083.4,742.53],[null,null,2192.4,null,null,null,5221.5,null],[null,null,1791.4,null,null,null,4660.6,null],[null,null,1727.5,null,null,null,6841.6,null],[null,null,2157.3,null,null,null,6448.2,null],[null,null,1398,null,null,null,6412.6,null],["190321S_LCA10_X_FP97AG","190222S_LCA9_X_FP94BM","190914S_LCB3_X_16plex_Set_21","190222S_LCA9_X_FP94BM","190321S_LCA10_X_FP97AG","190222S_LCA9_X_FP94BM","190914S_LCB3_X_16plex_Set_21","190321S_LCA10_X_FP97AG"]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>Sequence<\/th>\n <th>Length<\/th>\n <th>Charge<\/th>\n <th>Retention.time<\/th>\n <th>PEP<\/th>\n <th>Leading.razor.protein<\/th>\n <th>Reporter.intensity.1<\/th>\n <th>Reporter.intensity.2<\/th>\n <th>Reporter.intensity.3<\/th>\n <th>Reporter.intensity.4<\/th>\n <th>Reporter.intensity.5<\/th>\n <th>Reporter.intensity.6<\/th>\n <th>Reporter.intensity.7<\/th>\n <th>Reporter.intensity.8<\/th>\n <th>Reporter.intensity.9<\/th>\n <th>Reporter.intensity.10<\/th>\n <th>Reporter.intensity.11<\/th>\n <th>Reporter.intensity.12<\/th>\n <th>Reporter.intensity.13<\/th>\n <th>Reporter.intensity.14<\/th>\n <th>Reporter.intensity.15<\/th>\n <th>Reporter.intensity.16<\/th>\n <th>Raw.file<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"scrollX":"200px","paging":false,"info":false,"columnDefs":[{"className":"dt-right","targets":[2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]},{"orderable":false,"targets":0}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
]
]
???
### Description
The input table is typically a table that is generated by a
pre-processing software, such as MaxQuant or ProteomeDiscoverer.
The input table usually contains 3 types of columns:
- First, some columns hold the feature annotation, think about the peptide
sequence, the charge of the analyzed ion, the protein name
- You also have columns that hold the quantification data. The number
of columns may vary depending on the technology and the pre-processing
software.
- The last type of columns contain data associated to the mass
spectrometry acquisition. For instance, the name of the file where
the instrument has stored the data.
Let's have a look at some example data
### Example
The first columns here are annotations of the features, with the
peptide sequence, its length, the ion charge, etc. Then, there is the
quantitative data and you can see all elements are numbers that
correspond to ion intensities. You can identify the quantitative data in this specific
example because the column names start with `Reporter.intensity.`
followed by a number. The last columns is the name of the acquisition
and relates to the mass spectrometry run.
---
class:
## Sample annotation
.panelset[
.panel[.panel-name[Description]
.left-column[
<img src="./figs/read_scp_data_sampleTable.png" width="80%" style="display: block; margin: auto;" />
]
.right-column[
Sample table = table generated by the researcher.
1 line = 1 sample
Two columns are **required**:
- Names of the quantification columns from the input table
- Acquisition name, same as in the input table
Other columns can contain additional sample annotations, such as:
- Experiment metadata (date, researcher's name, instruments, ...)
- Sample preparation (cell culture batch, LC batch, TMT label, ...)
- Sample metadata (species, treatment, disease, sex, age, ...)
- Sample type (single-cells, carrier, blanks, ...)
- Other data (FACS data, microscopy data, phenotypic data, ...)
- ...
]
]
.panel[.panel-name[Example]
<div id="htmlwidget-e4d12c39fb939822482d" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-e4d12c39fb939822482d">{"x":{"filter":"none","data":[["1","2","3","4","5","6","7","8"],["190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM"],["Reporter.intensity.1","Reporter.intensity.2","Reporter.intensity.3","Reporter.intensity.4","Reporter.intensity.5","Reporter.intensity.6","Reporter.intensity.7","Reporter.intensity.8"],["Carrier","Reference","Unused","Monocyte","Blank","Monocyte","Macrophage","Macrophage"],["LCA9","LCA9","LCA9","LCA9","LCA9","LCA9","LCA9","LCA9"],["s8","s8","s8","s8","s8","s8","s8","s8"],["N","N","N","N","N","N","N","N"]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>Raw.file<\/th>\n <th>Channel<\/th>\n <th>SampleType<\/th>\n <th>lcbatch<\/th>\n <th>sortday<\/th>\n <th>digest<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"scrollX":"200px","paging":false,"info":false,"order":[],"autoWidth":false,"orderClasses":false,"columnDefs":[{"orderable":false,"targets":0}]}},"evals":[],"jsHooks":[]}</script>
]
]
???
### Description
Next to the input table, the `readSCP` function requires a sample table.
This is generated by the researcher. Each line contains information
about a single sample.
2 columns are required to work with `readSCP`. The first column tells
the software what are the names of the columns containing the
quantification data in the input table. The other column contains the
acquisition names, just like we saw for the input table.
Beside those 2 required columns, you can include any sample data you may
have, be it experimental metadata, sample preparation information,
sample types or other data collected during sample preparation. These
data are valuable when it comes to data modelling!
### Example
In this example, the 2 first columns are the required columns. The
first column is very similar to the column in the input data and may
notice that the second column holds the names that I pointed out as
quantitative columns in the input table that were starting with
`Reporter.intensity.`. The remaining columns are examples of
additional information that could be available.
---
class: middle, center, inverse
# What happens under the hood?
???
You may ask yourself: what is `readSCP` exactly doing?
---
class:
## What happens under the hood?
.panelset[
.panel[.panel-name[Step1]
.left-column[
<img src="./figs/read_scp_data_step1.svg" width="80%" style="display: block; margin: auto;" />
]
.right-column[
The feature annotations are separated from the quantitative data.
The two table pieces are converted to a
[`SingleCellExperiment`](https://www.bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html)
object [1], a specialized **Bioconductor** data container that creates an interface to
existing functions to analyse single-cell data.
<br><br><br>
<p style="color:grey;font-size:0.75em;">
[1] Amezquita, Robert A., Aaron T. L. Lun, Etienne Becht, Vince J. Carey, Lindsay N. Carpp, Ludwig Geistlinger, Federico Martini, et al. 2019. “Orchestrating Single-Cell Analysis with Bioconductor.” Nature Methods, December, 1–9.
</p>
]
]
.panel[.panel-name[Step2]
.left-column[
<img src="./figs/read_scp_data_step2.svg" width="100%" style="display: block; margin: auto;" />
]
.right-column[
The data is then split based on the acquisition name.
Each quantitative column now corresponds to a **single** and **unique**
sample.
]
]
.panel[.panel-name[Step3]
.pull-left[
<img src="./figs/read_scp_data_step3.svg" width="100%" style="display: block; margin: auto;" />
]
.pull-right[
The sample table is matched to the split feature data. This is
performed based on the two **required** columns:
- Acquisition name to match each data piece
- Quantification column names to match columns in each data piece
**Unique sample IDs** are created
]
]
.panel[.panel-name[Step4]
.pull-left[
<img src="./figs/read_scp_data_step4.svg" width="80%" style="display: block; margin: auto;" />
]
.pull-right[
All the data pieces are wrapped into a `QFeatures` object.
Overall, the `QFeatures` format enables seamless **data management and access**,
important for **downstream** data processing and visualisation.
]
]
]
???
Well, `readSCP` prepares the data in 4 main steps.
### Step1
First, it takes the input table and separates the feature annotation
from the quantitative data. The two tables can then be converted to a
SingleCellExperiment object that is a specialized Bioconductor data
container that creates an interface to existing functions to analyse
single-cell data.
### Step2
Next, the data is further split, but this time, the split is along the
rows based on the mass run. Because the
acquisitions are now separated, each quantitative column now corresponds
to a single and unique sample.
### Step3
In step3, the sample table comes in. The sample annotations are linked
to the quantification data and this is performed based on the two required columns I just described.
First, the acquisition names are matched between the input table and
the sample table. Next, the quantitative column names from the sample
tables are used to link each sample to its corresponding quantification
column. The combination of quantification column name and acquisition
name creates unique sample identifiers that are stored in the sample
table.
### Step4
The final step is to wrap all those data pieces into a `QFeatures`
object. Overall, the QFeatures format enables seamless data management
and access that are important for downstream data processing and
visualisation.
---
class: middle, center, inverse
# readSCP() in practice
???
Let me now show you how to use `readSCP` in practice
---
class:
## `readSCP()` in practice
.panelset[
.panel[.panel-name[Data]
.pull-left[
`sampleTable`
<div id="htmlwidget-1c80a576ba5cda651c77" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-1c80a576ba5cda651c77">{"x":{"filter":"none","data":[["1","2","3","4","5","6"],["190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM","190222S_LCA9_X_FP94BM"],["Reporter.intensity.1","Reporter.intensity.2","Reporter.intensity.3","Reporter.intensity.4","Reporter.intensity.5","Reporter.intensity.6"]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>Raw.file<\/th>\n <th>Channel<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"scrollX":"200px","paging":false,"info":false,"order":[],"autoWidth":false,"orderClasses":false,"columnDefs":[{"orderable":false,"targets":0}]}},"evals":[],"jsHooks":[]}</script>
]
.pull-right[
`inputTable`
<div id="htmlwidget-b8421309a5fba82d2e65" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-b8421309a5fba82d2e65">{"x":{"filter":"none","data":[["1","2","3","4","5","6"],["190321S_LCA10_X_FP97AG","190222S_LCA9_X_FP94BM","190914S_LCB3_X_16plex_Set_21","190222S_LCA9_X_FP94BM","190321S_LCA10_X_FP97AG","190222S_LCA9_X_FP94BM"],[61251,58648,150350,27347,84035,44895],[501.71,1099.8,3705,405.9,583.09,700.23],[3731.3,2837.7,9361,1525.2,4092.3,2283],[1643.3,494.32,0,0,530.13,1109.6],[871.84,349.26,1945.4,0,718.13,0],[981.87,1030.5,1188.6,318.74,2204.5,675.79],[1200.1,0,1574,0,960.51,0],[939.06,1214.1,2302.1,519.81,453.77,809.38],[1457.5,800.58,2176.1,0,1188.4,668.88],[1329.8,807.79,1399.5,507.23,740.99,1467.5],[981.83,391.38,1307.5,370.79,0,901.38],[null,null,2192.4,null,null,null],[null,null,1791.4,null,null,null],[null,null,1727.5,null,null,null],[null,null,2157.3,null,null,null],[null,null,1398,null,null,null]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>Raw.file<\/th>\n <th>Reporter.intensity.1<\/th>\n <th>Reporter.intensity.2<\/th>\n <th>Reporter.intensity.3<\/th>\n <th>Reporter.intensity.4<\/th>\n <th>Reporter.intensity.5<\/th>\n <th>Reporter.intensity.6<\/th>\n <th>Reporter.intensity.7<\/th>\n <th>Reporter.intensity.8<\/th>\n <th>Reporter.intensity.9<\/th>\n <th>Reporter.intensity.10<\/th>\n <th>Reporter.intensity.11<\/th>\n <th>Reporter.intensity.12<\/th>\n <th>Reporter.intensity.13<\/th>\n <th>Reporter.intensity.14<\/th>\n <th>Reporter.intensity.15<\/th>\n <th>Reporter.intensity.16<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"scrollX":"200px","paging":false,"info":false,"columnDefs":[{"className":"dt-right","targets":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]},{"orderable":false,"targets":0}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
]
]
.panel[.panel-name[Code]
```r
readSCP(inputTable,
sampleTable,
batchCol = "Raw.file",
channelCol = "Channel")
```
Overview of the resulting `QFeatures` object:
```
## An instance of class QFeatures containing 4 assays:
## [1] 190222S_LCA9_X_FP94BM: SingleCellExperiment with 395 rows and 16 columns
## [2] 190321S_LCA10_X_FP97_blank_01: SingleCellExperiment with 109 rows and 16 columns
## [3] 190321S_LCA10_X_FP97AG: SingleCellExperiment with 487 rows and 16 columns
## [4] 190914S_LCB3_X_16plex_Set_21: SingleCellExperiment with 370 rows and 16 columns
```
]
]
???
### Data
Consider the two example tables here that are very similar to the ones I
showed previously. Note that both table contain the `Raw.file` column
necessary for mathcing the acquisition runs. See also that the `Channel`
column in the `sampleTable` contains the column names corresponding to
the quantification columns in the `inputTable`.
### Code
You can convert those two tables to a `QFeatures` object using
`readSCP()` by running the command shown here. We call `readSCP()`, we
provide the 2 tables, but we also need to tell how the matching is
performed. We here tell the function which column in both tables
should be used to match the acquisition batch, in this case remember
it was `Raw.file`. Then, we need to tell the function which column in
the sample table contains the quantification columns, it's the column
called `Channel` in this example.
When running the command, we create a new object and you can find an
overview here. You can see that we indeed have a `QFeatures` object with 4 assays
because there are 4 acquisitions. Each assay is a SingleCellExperiment
object with variable number of rows, here corresponding to different
quantified PSMs and 16 columns because a multiplexing with 16 labels
was used to acquire the data.
---
class: middle, inverse, center
# What if I acquired a single acquisition or already processed my data?
???
As a mention, you can also import data from a single acquisition or
import already processed single-cell proteomics data.
---
class: middle
## What if I acquired a single acquisition or already processed my data?
`readQFeatures()`: import pre-processed data for a single acquisition
as a `QFeatures` object.
```r
readQFeatures(inputTable, ecol = paste0("Reporter.intensity.", 1:16),
colData = sampleTable)
```
`readSingleCellExperiment()`: import data as a `SingleCellExperiment`
object.
```r
readSingleCellExperiment(inputTable, ecol = paste0("Reporter.intensity.", 1:16),
colData = sampleTable)
```
Both functions require:
- input table
- quantification column names
Optional: sample annotation table.
???
Suppose you acquired data from a single acquisition, you may not want
to bother with splitting your data using `readSCP()` but rather use
the simpler function `readQFeatures()`.
Also, if you have already processed your data or if you downloaded data
ready to analyse, you may simply want to load it as a
`SingleCellExperiment` object for downstream analyses (we will come to
that in the next slide deck). You can do so using the `readSingleCellExperiment()`.
Both functions require an input table, similar to `readSCP` and you need
to point out which columns are the quantification columns. Optionally, you
can provide sample annotations.
I hope this presentation helped you understand how to get your
single-cell proteomics data into R for data processing and analysis
using our software.
---
class: middle, inverse, center
# Exercise
???
I suggest to test your understanding with a small exercise.
---
class: middle
#### Given the input and sample tables, what command creates a single-cell proteomics QFeatures object?
.pull-left[
`inputTable`
<div id="htmlwidget-63b0c0fda44a940641cd" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-63b0c0fda44a940641cd">{"x":{"filter":"none","data":[["1","2","3"],["A","A","B"],["AYGGEGP","QSRTSGRG","QSRTSGRG"],[3253,6505,8639],[4981,8032,5938]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>MSrun<\/th>\n <th>Peptide<\/th>\n <th>lab1<\/th>\n <th>lab2<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"paging":false,"searching":false,"info":false,"columnDefs":[{"className":"dt-right","targets":[3,4]},{"orderable":false,"targets":0}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
]
.pull-right[
`sampleTable`
<div id="htmlwidget-8d44dc5dadd6906ee933" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-8d44dc5dadd6906ee933">{"x":{"filter":"none","data":[["1","2","3","4","5","6"],["A","A","A","A","B","B"],["lab1","lab2","lab1","lab2","lab1","lab2"],["HeLa","HEK293","HeLa","HEK293","HeLa","HEK293"]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>MSrun<\/th>\n <th>Label<\/th>\n <th>CellType<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"paging":false,"searching":false,"info":false,"order":[],"autoWidth":false,"orderClasses":false,"columnDefs":[{"orderable":false,"targets":0}]}},"evals":[],"jsHooks":[]}</script>
]
```r
1. readSCP(inputTable, sampleTable, batchCol = "Label", channelCol = c("lab1", "lab2"))
2. readSCP(inputTable, sampleTable, batchCol = "MSrun", channelCol = c("lab1", "lab2"))
3. readSCP(inputTable, sampleTable, batchCol = "MSrun", channelCol = "Label")
4. readSCP(inputTable, sampleTable, batchCol = "CellType", channelCol = "Label")
```
Connect to **http://www.wooclap.com/YYRQRM**
???
Given the input and sample tables, What command creates a single-cell
proteomics QFeatures object?
Command 1, 2, 3 or 4? You can pause the video to think about it... The
solution is command 3. See that we can match the acquisition runs using
the `MSrun` column in both tables and the `Label` column in the sample
table contains the quantification column names of the input table.
---
class: middle
### Further information
Learn more about loading single-cell proteomics data as a `QFeatures`
object in our dedicated vignette at
https://uclouvain-cbio.github.io/scp/articles/read_scp.html.
### Funding
Fonds de la Recherche Scientifique (FNRS), Belgium
???
I hope you found the correct solution. If you're looking for more
detailed information, you can have a look at our vignette dedicated to
loading single-cell proteomics data. Thank you very much for watching
and see you in another video.
</textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"highlightStyle": "github",
"highlightLines": true,
"ratio": "16:9",
"countIncrementalSlides": true
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function(d) {
var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})(document);
(function(d) {
var el = d.getElementsByClassName("remark-slides-area");
if (!el) return;
var slide, slides = slideshow.getSlides(), els = el[0].children;
for (var i = 1; i < slides.length; i++) {
slide = slides[i];
if (slide.properties.continued === "true" || slide.properties.count === "false") {
els[i - 1].className += ' has-continuation';
}
}
var s = d.createElement("style");
s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
var deleted = false;
slideshow.on('beforeShowSlide', function(slide) {
if (deleted) return;
var sheets = document.styleSheets, node;
for (var i = 0; i < sheets.length; i++) {
node = sheets[i].ownerNode;
if (node.dataset["target"] !== "print-only") continue;
node.parentNode.removeChild(node);
}
deleted = true;
});
})();
(function() {
"use strict"
// Replace <script> tags in slides area to make them executable
var scripts = document.querySelectorAll(
'.remark-slides-area .remark-slide-container script'
);
if (!scripts.length) return;
for (var i = 0; i < scripts.length; i++) {
var s = document.createElement('script');
var code = document.createTextNode(scripts[i].textContent);
s.appendChild(code);
var scriptAttrs = scripts[i].attributes;
for (var j = 0; j < scriptAttrs.length; j++) {
s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
}
scripts[i].parentElement.replaceChild(s, scripts[i]);
}
})();
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
links[i].target = '_blank';
}
}
})();
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
const hlines = d.querySelectorAll('.remark-code-line-highlighted');
const preParents = [];
const findPreParent = function(line, p = 0) {
if (p > 1) return null; // traverse up no further than grandparent
const el = line.parentElement;
return el.tagName === "PRE" ? el : findPreParent(el, ++p);
};
for (let line of hlines) {
let pre = findPreParent(line);
if (pre && !preParents.includes(pre)) preParents.push(pre);
}
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>
<script>
slideshow._releaseMath = function(el) {
var i, text, code, codes = el.getElementsByTagName('code');
for (i = 0; i < codes.length;) {
code = codes[i];
if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
text = code.textContent;
if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
/^\$\$(.|\s)+\$\$$/.test(text) ||
/^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
code.outerHTML = code.innerHTML; // remove <code></code>
continue;
}
}
i++;
}
};
slideshow._releaseMath(document);
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML';
if (location.protocol !== 'file:' && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName('head')[0].appendChild(script);
})();
</script>
</body>
</html>