/
data.R
285 lines (282 loc) · 10.9 KB
/
data.R
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
##' @title Example MaxQuant/SCoPE2 output
##'
##' @description
##'
##' A `data.frame` with 1088 observations and 139 variables, as
##' produced by reading a MaxQuant output file with
##' [read.delim()].
##'
##' - Sequence: a character vector
##' - Length: a numeric vector
##' - Modifications: a character vector
##' - Modified.sequence: a character vector
##' - Deamidation..N..Probabilities: a character vector
##' - Oxidation..M..Probabilities: a character vector
##' - Deamidation..N..Score.Diffs: a character vector
##' - Oxidation..M..Score.Diffs: a character vector
##' - Acetyl..Protein.N.term.: a numeric vector
##' - Deamidation..N.: a numeric vector
##' - Oxidation..M.: a numeric vector
##' - Missed.cleavages: a numeric vector
##' - Proteins: a character vector
##' - Leading.proteins: a character vector
##' - protein: a character vector
##' - Gene.names: a character vector
##' - Protein.names: a character vector
##' - Type: a character vector
##' - Set: a character vector
##' - MS.MS.m.z: a numeric vector
##' - Charge: a numeric vector
##' - m.z: a numeric vector
##' - Mass: a numeric vector
##' - Resolution: a numeric vector
##' - Uncalibrated...Calibrated.m.z..ppm.: a numeric vector
##' - Uncalibrated...Calibrated.m.z..Da.: a numeric vector
##' - Mass.error..ppm.: a numeric vector
##' - Mass.error..Da.: a numeric vector
##' - Uncalibrated.mass.error..ppm.: a numeric vector
##' - Uncalibrated.mass.error..Da.: a numeric vector
##' - Max.intensity.m.z.0: a numeric vector
##' - Retention.time: a numeric vector
##' - Retention.length: a numeric vector
##' - Calibrated.retention.time: a numeric vector
##' - Calibrated.retention.time.start: a numeric vector
##' - Calibrated.retention.time.finish: a numeric vector
##' - Retention.time.calibration: a numeric vector
##' - Match.time.difference: a logical vector
##' - Match.m.z.difference: a logical vector
##' - Match.q.value: a logical vector
##' - Match.score: a logical vector
##' - Number.of.data.points: a numeric vector
##' - Number.of.scans: a numeric vector
##' - Number.of.isotopic.peaks: a numeric vector
##' - PIF: a numeric vector
##' - Fraction.of.total.spectrum: a numeric vector
##' - Base.peak.fraction: a numeric vector
##' - PEP: a numeric vector
##' - MS.MS.count: a numeric vector
##' - MS.MS.scan.number: a numeric vector
##' - Score: a numeric vector
##' - Delta.score: a numeric vector
##' - Combinatorics: a numeric vector
##' - Intensity: a numeric vector
##' - Reporter.intensity.corrected.0: a numeric vector
##' - Reporter.intensity.corrected.1: a numeric vector
##' - Reporter.intensity.corrected.2: a numeric vector
##' - Reporter.intensity.corrected.3: a numeric vector
##' - Reporter.intensity.corrected.4: a numeric vector
##' - Reporter.intensity.corrected.5: a numeric vector
##' - Reporter.intensity.corrected.6: a numeric vector
##' - Reporter.intensity.corrected.7: a numeric vector
##' - Reporter.intensity.corrected.8: a numeric vector
##' - Reporter.intensity.corrected.9: a numeric vector
##' - Reporter.intensity.corrected.10: a numeric vector
##' - RI1: a numeric vector
##' - RI2: a numeric vector
##' - RI3: a numeric vector
##' - RI4: a numeric vector
##' - RI5: a numeric vector
##' - RI6: a numeric vector
##' - RI7: a numeric vector
##' - RI8: a numeric vector
##' - RI9: a numeric vector
##' - RI10: a numeric vector
##' - RI11: a numeric vector
##' - Reporter.intensity.count.0: a numeric vector
##' - Reporter.intensity.count.1: a numeric vector
##' - Reporter.intensity.count.2: a numeric vector
##' - Reporter.intensity.count.3: a numeric vector
##' - Reporter.intensity.count.4: a numeric vector
##' - Reporter.intensity.count.5: a numeric vector
##' - Reporter.intensity.count.6: a numeric vector
##' - Reporter.intensity.count.7: a numeric vector
##' - Reporter.intensity.count.8: a numeric vector
##' - Reporter.intensity.count.9: a numeric vector
##' - Reporter.intensity.count.10: a numeric vector
##' - Reporter.PIF: a logical vector
##' - Reporter.fraction: a logical vector
##' - Reverse: a character vector
##' - Potential.contaminant: a logical vector
##' - id: a numeric vector
##' - Protein.group.IDs: a character vector
##' - Peptide.ID: a numeric vector
##' - Mod..peptide.ID: a numeric vector
##' - MS.MS.IDs: a character vector
##' - Best.MS.MS: a numeric vector
##' - AIF.MS.MS.IDs: a logical vector
##' - Deamidation..N..site.IDs: a numeric vector
##' - Oxidation..M..site.IDs: a logical vector
##' - remove: a logical vector
##' - dart_PEP: a numeric vector
##' - dart_qval: a numeric vector
##' - razor_protein_fdr: a numeric vector
##' - Deamidation..NQ..Probabilities: a logical vector
##' - Deamidation..NQ..Score.Diffs: a logical vector
##' - Deamidation..NQ.: a logical vector
##' - Reporter.intensity.corrected.11: a logical vector
##' - Reporter.intensity.corrected.12: a logical vector
##' - Reporter.intensity.corrected.13: a logical vector
##' - Reporter.intensity.corrected.14: a logical vector
##' - Reporter.intensity.corrected.15: a logical vector
##' - Reporter.intensity.corrected.16: a logical vector
##' - RI12: a logical vector
##' - RI13: a logical vector
##' - RI14: a logical vector
##' - RI15: a logical vector
##' - RI16: a logical vector
##' - Reporter.intensity.count.11: a logical vector
##' - Reporter.intensity.count.12: a logical vector
##' - Reporter.intensity.count.13: a logical vector
##' - Reporter.intensity.count.14: a logical vector
##' - Reporter.intensity.count.15: a logical vector
##' - Reporter.intensity.count.16: a logical vector
##' - Deamidation..NQ..site.IDs: a logical vector
##' - input_id: a logical vector
##' - rt_minus: a logical vector
##' - rt_plus: a logical vector
##' - mu: a logical vector
##' - muij: a logical vector
##' - sigmaij: a logical vector
##' - pep_new: a logical vector
##' - exp_id: a logical vector
##' - peptide_id: a logical vector
##' - stan_peptide_id: a logical vector
##' - exclude: a logical vector
##' - residual: a logical vector
##' - participated: a logical vector
##' - peptide: a character vector
##'
##' @usage data("mqScpData")
##'
##' @details
##'
##' The dataset is a subset of the SCoPE2 dataset (version 2, Specht
##' et al. 2019,
##' [BioRXiv](https://www.biorxiv.org/content/10.1101/665307v3)). The
##' input file `evidence_unfiltered.csv` was downloaded from a
##' [Google Drive repository](https://drive.google.com/drive/folders/1VzBfmNxziRYqayx3SP-cOe2gu129Obgx).
##' The MaxQuant evidence file was loaded and the data was cleaned
##' (renaming columns, removing duplicate fields,...). MS runs that
##' were selected in the `scp1` dataset (see `?scp1`) were kept along
##' with a blank run. The data is stored as a `data.frame`.
##'
##' @seealso [readSCP()] for an example on how `mqScpData` is
##' parsed into a [QFeatures] object.
##'
##' @md
"mqScpData"
##' @title Single cell sample annotation
##'
##' @description
##'
##' A data frame with 48 observations on the following 6 variables.
##' - Set: a character vector
##' - Channel: a character vector
##' - SampleType: a character vector
##' - lcbatch: a character vector
##' - sortday: a character vector
##' - digest: a character vector
##'
##' @usage data("sampleAnnotation")
##'
##' @details
##'
##' ##' The dataset is a subset of the SCoPE2 dataset (version 2, Specht
##' et al. 2019,
##' [BioRXiv](https://www.biorxiv.org/content/10.1101/665307v3)). The
##' input files `batch.csv` and `annotation.csv` were downloaded from a
##' [Google Drive repository](https://drive.google.com/drive/folders/1VzBfmNxziRYqayx3SP-cOe2gu129Obgx).
##' The two files were loaded and the columns names were adapted for
##' consistency with `mqScpData` table (see `?mqScpData`). The two
##' tables were filtered to contain only sets present in ``mqScpData`.
##' The tables were then merged based on the run ID, hence merging the
##' sample annotation and the batch annotation. Finally, annotation
##' for the blank run was added manually. The data is stored as a
##' `data.frame`.
##'
##' @seealso [readSCP()] to see how this file is used.
##'
##' @md
"sampleAnnotation"
##' @title Single Cell QFeatures data
##'
##' @description
##'
##' A small [QFeatures] object with SCoPE2 data. The object is
##' composed of 5 assays, including 3 PSM-level assays, 1 peptide
##' assay and 1 protein assay.
##'
##' @usage data("scp1")
##'
##' @details
##'
##' The dataset is a subset of the SCoPE2 dataset (version 2, Specht
##' et al. 2019,
##' [BioRXiv](https://www.biorxiv.org/content/10.1101/665307v3)).
##' This dataset was converted to a [`QFeatures`] object where each
##' assay in stored as a [`SingleCellExperiment`] object. One assay
##' per chromatographic batch ("LCA9", "LCA10", "LCB3") was randomly
##' sampled. For each assay, 100 proteins were randomly sampled. PSMs
##' were then aggregated to peptides and joined in a single assay.
##' Then peptides were aggregated to proteins.
##'
##' @md
##'
##' @docType data
##'
##' @examples
##' data("scp1")
##' scp1
"scp1"
##' @title Minimally processed single-cell proteomics data set
##'
##' @description
##'
##' A `SingleCellExperiment` object that has been minimally processed.
##' The data set is published by Leduc et al. 2022 (see references)
##' and retrieved using `scpdata::leduc2022_pSCoPE()`. The data
##' processing was conducted with `QFeatures` and `scp`. Quality control
##' was performed, followed by building the peptide data and
##' log2-transformation. To limit the size of the data, only cells
##' associated to the 3 first and 3 last MS acquisition runs were
##' kept. For the same reason, 200 peptides were randomly
##' sampled. Therefore, the data set consists of 200 peptides and
##' 73 cells. Peptide annotations can be retrieved from the `rowData`
##' and cell annotations can be retrieved from the `colData`.
##'
##' @section Quality control:
##'
##' Any zero value has been replaced by NA.
##'
##' A peptide was removed from the data set if:
##' - it matched to a decoy or contaminant peptide
##' - it had an parental ion fraction below 60 \%
##' - it had a DART-ID adjusted q-value superior to 1\%
##' - it had an average sample to carrier ratio above 0.05
##'
##' A cell was removed from the data set if:
##' - it had a median coefficient of variation superior to 0.6
##' - it had a log2 median intensity outside (6, 8)
##' - it contained less than 750 peptides
##'
##' @section Building the peptide matrix:
##'
##' PSMs belonging to the same peptide were aggregating using the
##' median value. Some peptides were mapped to a different protein
##' depending on the MS acquisition run. To solve this issue, a
##' majority vote was applied to assign a single protein to each
##' peptide. Protein IDs were translated into gene symbols using the
##' `ensembldb` package.
##'
##' @usage data("leduc_minimal")
##'
##' @references
##'
##' Leduc, Andrew, R. Gray Huffman, Joshua Cantlon, Saad Khan, and
##' Nikolai Slavov. 2022. “Exploring Functional Protein Covariation
##' across Single Cells Using nPOP.” Genome Biology 23 (1): 261.
##'
##' @author Christophe Vanderaa, Laurent Gatto
##'
##' @md
"leduc_minimal"