-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.Rhistory
512 lines (512 loc) · 23.4 KB
/
.Rhistory
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
enrichment_method = "correlation_enrichment",
datamatrix=protdata[,shortlist])
knitr::kable(head(protdata.enrichment.correlation.short[order(protdata.enrichment.correlation.short[,"pvalue"]),]))
protdata.enrichment.correlation.long = leapR(geneset=ncipid,
enrichment_method = "correlation_enrichment",
datamatrix=protdata[,longlist])
knitr::kable(head(protdata.enrichment.correlation.long[order(protdata.enrichment.correlation.long[,"pvalue"]),]))
# load phosphoproteomics data for 69 tumors
data("phosphodata")
data("kinasesubstrates")
# for an individual tumor calculate the Kinase-Substrate Enrichment (similar to KSEA)
# This uses the site-specific phosphorylation data to determine which kinases
# might be active by assessing the enrichment of the phosphorylation of their known substrates
phosphodata.ksea.order = leapR(geneset=kinasesubstrates,
enrichment_method="enrichment_in_order",
datamatrix=phosphodata,
primary_columns="TCGA-13-1484")
knitr::kable(phosphodata.ksea.order[order(phosphodata.ksea.order[,"pvalue"]),][1:10,])
# now do the same thing but use a threshold
phosphodata.sets.order = leapR(geneset=kinasesubstrates,
enrichment_method="enrichment_in_sets",
datamatrix=phosphodata, threshold=1.0,
primary_columns="TCGA-13-1484")
knitr::kable(phosphodata.sets.order[order(phosphodata.sets.order[,"pvalue"]),][1:10,])
#load the single omic and multi-omic pathway databases
data("krbpaths")
data("mo_krbpaths")
# comparison enrichment in transcriptional data
transdata.comp.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=transdata, primary_columns=shortlist,
secondary_columns=longlist)
# comparison enrichment in proteomics data
# this is the same code used above, just repeated here for clarity
protdata.comp.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=protdata, primary_columns=shortlist,
secondary_columns=longlist)
# comparison enrichment in phosphoproteomics data
phosphodata.comp.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=phosphodata, primary_columns=shortlist,
secondary_columns=longlist, id_column=1)
# set enrichment in transcriptomics data
# perform the comparison t test
transdata.svl.ttest = t(sapply(rownames(transdata), function (r) {
res=try(t.test(transdata[r,shortlist], transdata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
colnames(transdata.svl.ttest) = c('p-value','difference')
transdata.set.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_sets',
datamatrix=transdata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# set enrichment in proteomics data
# perform the comparison t test
protdata.svl.ttest = t(sapply(rownames(protdata), function (r) {
res=try(t.test(protdata[r,shortlist], protdata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
colnames(protdata.svl.ttest) = c('p-value','difference')
protdata.set.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_sets',
datamatrix=protdata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# set enrichment in phosphoproteomics data
# perform the comparison t test
phosphodata.svl.ttest = t(sapply(rownames(phosphodata), function (r) {
res=try(t.test(phosphodata[r,shortlist], phosphodata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
phosphodata.svl.ttest = data.frame(protein=phosphodata[,1], pvalue=phosphodata.svl.ttest[,1],
difference=phosphodata.svl.ttest[,2])
colnames(phosphodata.svl.ttest) = c('protein', 'p-value','difference')
phosphodata.set.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_sets',
id_column="protein",
datamatrix=phosphodata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# order enrichment in transcriptomics data
transdata.order.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_order',
datamatrix=transdata.svl.ttest, primary_columns="difference")
# order enrichment in proteomics data
protdata.order.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_order',
datamatrix=protdata.svl.ttest, primary_columns="difference")
# order enrichment in phosphoproteomics data
phosphodata.order.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_order',
id_column=1,
datamatrix=phosphodata.svl.ttest, primary_columns="difference")
# correlation difference in transcriptomics data
transdata.corr.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method="correlation_comparison",
datamatrix=transdata, primary_columns=shortlist,
secondary_columns=longlist)
source("R/leapR.R")
# correlation difference in transcriptomics data
transdata.corr.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method="correlation_comparison",
datamatrix=transdata, primary_columns=shortlist,
secondary_columns=longlist)
roxygen2::roxygenise()
roxygen2::roxygenise()
roxygen2::roxygenise()
devtools::install_github("biodataganache/leapR",build_vignette=TRUE)
data(krbpaths)
data("mo_krbpaths")
unlink('vignettes/leapr_cache', recursive = TRUE)
devtools::install()
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(leapr)
data(msigdb)
data(ncipid)
data(protdata)
data(transdata)
data(shortlist)
data(longlist)
# in this example we lump a bunch of patients together (the 'short survivors') and compare
# them to another group (the 'long survivors')
###using enrichment_wrapper function
protdata.enrichment.svl = leapR(geneset=ncipid,
enrichment_method='enrichment_comparison',
datamatrix=protdata, primary_columns=shortlist,
secondary_columns=longlist)
knitr::kable(protdata.enrichment.svl[order(protdata.enrichment.svl[,"pvalue"]),][1:10,])
# another application is to compare just one patient against another (this would be the
# equivalent of comparing one time point to another)
###using enrichment_wrapper function
protdata.enrichment.svl.ovo = leapR(geneset=ncipid,
enrichment_method='enrichment_comparison',
datamatrix=protdata,
primary_columns=shortlist[1],
secondary_columns=longlist[1])
knitr::kable(protdata.enrichment.svl.ovo[order(protdata.enrichment.svl.ovo[,"pvalue"]),][1:10,])
# for this example we will construct a list of genes from the expression data
# to emulate what you might be inputting
genelist = rownames(protdata)[which(protdata[,1]>0.5)]
background = rownames(protdata)
###using enrichment_wrapper function
protdata.enrichment.order = leapR(geneset=ncipid,
enrichment_method="enrichment_in_order",
datamatrix=protdata, threshold=.5,
primary_columns="TCGA-13-1484")
knitr::kable(protdata.enrichment.order[order(protdata.enrichment.order[,"pvalue"]),][1:10,])
# in this example we construct some modules from the hierarchical clustering of the
# data
protdata_naf = as.matrix(protdata)
# hierarchical clustering is not too happy with lots of missing values
# so we'll do a zero fill on this to get the modules
protdata_naf[which(is.na(protdata_naf))] = 0
# construct the hierarchical clustering using the 'wardD' method, which
# seems to give more even sized modules
protdata_hc = hclust(dist(protdata_naf), method="ward.D2")
# arbitrarily we'll chop the clusters into 5 modules
modules = cutree(protdata_hc, k=5)
##sara: created list
clusters = lapply(unique(modules),function(x) names(which(modules==x)))
# modules is a named list of values where each value is a module
# number and the name is the gene name
# To do enrichment for one module (module 1 in this case) do this
protdata.enrichment.sets.module_1 = leapR(geneset=ncipid, enrichment_method="enrichment_in_sets",
background=names(modules),
targets=names(modules[which(modules==1)]))
# To do enrichment on all modules and return the list of enrichment results tables do this
protdata.enrichment.sets.modules = cluster_enrichment(geneset=ncipid, clusters=clusters, background=names(modules), sigfilter=0.5)
knitr::kable(head(protdata.enrichment.sets.modules))
# This is how you calculate enrichment in a ranked list (for example from topology)
###using enrichment_wrapper function
protdata.enrichment.sets = leapR(geneset=ncipid, "enrichment_in_order",
datamatrix=protdata,
primary_columns=shortlist[1])
knitr::kable(protdata.enrichment.sets[order(protdata.enrichment.sets[,"pvalue"]),][1:10,])
###using enrichment_wrapper function
protdata.enrichment.correlation = leapR(geneset=ncipid,
enrichment_method = "correlation_enrichment",
datamatrix=protdata)
knitr::kable(head(protdata.enrichment.correlation[order(protdata.enrichment.correlation[,"pvalue"]),]))
protdata.enrichment.correlation.short = leapR(geneset=ncipid,
enrichment_method = "correlation_enrichment",
datamatrix=protdata[,shortlist])
knitr::kable(head(protdata.enrichment.correlation.short[order(protdata.enrichment.correlation.short[,"pvalue"]),]))
protdata.enrichment.correlation.long = leapR(geneset=ncipid,
enrichment_method = "correlation_enrichment",
datamatrix=protdata[,longlist])
knitr::kable(head(protdata.enrichment.correlation.long[order(protdata.enrichment.correlation.long[,"pvalue"]),]))
# load phosphoproteomics data for 69 tumors
data("phosphodata")
data("kinasesubstrates")
# for an individual tumor calculate the Kinase-Substrate Enrichment (similar to KSEA)
# This uses the site-specific phosphorylation data to determine which kinases
# might be active by assessing the enrichment of the phosphorylation of their known substrates
phosphodata.ksea.order = leapR(geneset=kinasesubstrates,
enrichment_method="enrichment_in_order",
datamatrix=phosphodata,
primary_columns="TCGA-13-1484")
knitr::kable(phosphodata.ksea.order[order(phosphodata.ksea.order[,"pvalue"]),][1:10,])
# now do the same thing but use a threshold
phosphodata.sets.order = leapR(geneset=kinasesubstrates,
enrichment_method="enrichment_in_sets",
datamatrix=phosphodata, threshold=1.0,
primary_columns="TCGA-13-1484")
knitr::kable(phosphodata.sets.order[order(phosphodata.sets.order[,"pvalue"]),][1:10,])
#load the single omic and multi-omic pathway databases
data("krbpaths")
data("mo_krbpaths")
# comparison enrichment in transcriptional data
transdata.comp.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=transdata, primary_columns=shortlist,
secondary_columns=longlist)
# comparison enrichment in proteomics data
# this is the same code used above, just repeated here for clarity
protdata.comp.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=protdata, primary_columns=shortlist,
secondary_columns=longlist)
# comparison enrichment in phosphoproteomics data
phosphodata.comp.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=phosphodata, primary_columns=shortlist,
secondary_columns=longlist, id_column=1)
# set enrichment in transcriptomics data
# perform the comparison t test
transdata.svl.ttest = t(sapply(rownames(transdata), function (r) {
res=try(t.test(transdata[r,shortlist], transdata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
colnames(transdata.svl.ttest) = c('p-value','difference')
transdata.set.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_sets',
datamatrix=transdata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# set enrichment in proteomics data
# perform the comparison t test
protdata.svl.ttest = t(sapply(rownames(protdata), function (r) {
res=try(t.test(protdata[r,shortlist], protdata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
colnames(protdata.svl.ttest) = c('p-value','difference')
protdata.set.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_sets',
datamatrix=protdata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# set enrichment in phosphoproteomics data
# perform the comparison t test
phosphodata.svl.ttest = t(sapply(rownames(phosphodata), function (r) {
res=try(t.test(phosphodata[r,shortlist], phosphodata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
phosphodata.svl.ttest = data.frame(protein=phosphodata[,1], pvalue=phosphodata.svl.ttest[,1],
difference=phosphodata.svl.ttest[,2])
colnames(phosphodata.svl.ttest) = c('protein', 'p-value','difference')
phosphodata.set.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_sets',
id_column="protein",
datamatrix=phosphodata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# order enrichment in transcriptomics data
transdata.order.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_order',
datamatrix=transdata.svl.ttest, primary_columns="difference")
# order enrichment in proteomics data
protdata.order.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_order',
datamatrix=protdata.svl.ttest, primary_columns="difference")
# order enrichment in phosphoproteomics data
phosphodata.order.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method='enrichment_in_order',
id_column=1,
datamatrix=phosphodata.svl.ttest, primary_columns="difference")
# correlation difference in transcriptomics data
transdata.corr.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method="correlation_comparison",
datamatrix=transdata, primary_columns=shortlist,
secondary_columns=longlist)
# correlation difference in proteomics data
protdata.corr.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method="correlation_comparison",
datamatrix=protdata, primary_columns=shortlist,
secondary_columns=longlist)
# correlation difference in phosphoproteomics data
phosphodata.corr.enrichment.svl = leapR(geneset=krbpaths,
enrichment_method="correlation_comparison",
datamatrix=phosphodata, primary_columns=shortlist,
secondary_columns=longlist, id_column=1)
#combine the omics data into one with prefix tags
combodata = combine_omics(proteomics=protdata, transcriptomics=transdata, phospho=phosphodata, id_column=1)
# comparison enrichment for combodata
combodata.enrichment.svl = leapR(geneset=mo_krbpaths,
enrichment_method='enrichment_comparison',
datamatrix=combodata, primary_columns=shortlist,
secondary_columns=longlist, id_column=1)
# set enrichment in combo data
# perform the comparison t test
combodata.svl.ttest = t(sapply(rownames(combodata), function (r) {
res=try(t.test(combodata[r,shortlist], combodata[r,longlist]));
if (class(res) == 'try-error') return(c(NA, NA));
return(c(res$p.value, res$estimate[[1]]-res$estimate[[2]]))}))
combodata.svl.ttest = data.frame(protein=combodata[,1], pvalue=combodata.svl.ttest[,1],
difference=combodata.svl.ttest[,2])
colnames(combodata.svl.ttest) = c('protein', 'p-value','difference')
combodata.set.enrichment.svl = leapR(geneset=mo_krbpaths,
enrichment_method='enrichment_in_sets',
datamatrix=combodata.svl.ttest, primary_columns="p-value",
greaterthan=FALSE, threshold=0.05)
# order enrichment in transcriptomics data
combodata.order.enrichment.svl = leapR(geneset=mo_krbpaths,
enrichment_method='enrichment_in_order',
datamatrix=combodata.svl.ttest, primary_columns="difference")
# correlation difference in combo data
combodata.corr.enrichment.svl = leapR(geneset=mo_krbpaths,
enrichment_method="correlation_comparison",
datamatrix=combodata, primary_columns=shortlist,
secondary_columns=longlist)
# now take all these results and combine them into one figure
all_results = list(transdata.comp.enrichment.svl,
protdata.comp.enrichment.svl,
phosphodata.comp.enrichment.svl,
combodata.enrichment.svl,
transdata.set.enrichment.svl,
protdata.set.enrichment.svl,
phosphodata.set.enrichment.svl,
combodata.set.enrichment.svl,
transdata.order.enrichment.svl,
protdata.order.enrichment.svl,
phosphodata.order.enrichment.svl,
combodata.order.enrichment.svl,
transdata.corr.enrichment.svl,
protdata.corr.enrichment.svl,
phosphodata.corr.enrichment.svl,
combodata.corr.enrichment.svl)
pathways_of_interest = c("KEGG_APOPTOSIS",
"KEGG_CELL_CYCLE",
"KEGG_ERBB_SIGNALING_PATHWAY",
"KEGG_FOCAL_ADHESION",
"KEGG_INSULIN_SIGNALING_PATHWAY",
"KEGG_MAPK_SIGNALING_PATHWAY",
"KEGG_MISMATCH_REPAIR",
"KEGG_MTOR_SIGNALING_PATHWAY" ,
"KEGG_OXIDATIVE_PHOSPHORYLATION",
"KEGG_P53_SIGNALING_PATHWAY",
"KEGG_PATHWAYS_IN_CANCER",
"KEGG_PROTEASOME",
"KEGG_RIBOSOME",
"KEGG_VEGF_SIGNALING_PATHWAY",
"KEGG_WNT_SIGNALING_PATHWAY")
results.frame = data.frame(pathway=pathways_of_interest,
td.comp=all_results[[1]][pathways_of_interest,"BH_pvalue"]<0.05,
pd.comp=all_results[[2]][pathways_of_interest,"BH_pvalue"]<0.05,
fd.comp=all_results[[3]][pathways_of_interest,"BH_pvalue"]<0.05,
cd.comp=all_results[[4]][pathways_of_interest,"BH_pvalue"]<0.05,
td.set=all_results[[5]][pathways_of_interest,"BH_pvalue"]<0.05,
pd.set=all_results[[6]][pathways_of_interest,"BH_pvalue"]<0.05,
fd.set=all_results[[7]][pathways_of_interest,"BH_pvalue"]<0.05,
cd.set=all_results[[8]][pathways_of_interest,"BH_pvalue"]<0.05,
td.order=all_results[[9]][pathways_of_interest,"BH_pvalue"]<0.05,
pd.order=all_results[[10]][pathways_of_interest,"BH_pvalue"]<0.05,
fd.order=all_results[[11]][pathways_of_interest,"BH_pvalue"]<0.05,
cd.order=all_results[[12]][pathways_of_interest,"BH_pvalue"]<0.05,
td.corr=all_results[[13]][pathways_of_interest,"BH_pvalue"]<0.05,
pd.corr=all_results[[14]][pathways_of_interest,"BH_pvalue"]<0.05,
fd.corr=all_results[[15]][pathways_of_interest,"BH_pvalue"]<0.05,
cd.corr=all_results[[16]][pathways_of_interest,"BH_pvalue"]<0.05)
results.frame.or = data.frame(pathway=pathways_of_interest,
td.comp=all_results[[1]][pathways_of_interest,"oddsratio"],
pd.comp=all_results[[2]][pathways_of_interest,"oddsratio"],
fd.comp=all_results[[3]][pathways_of_interest,"oddsratio"],
cd.comp=all_results[[4]][pathways_of_interest,"oddsratio"],
td.set=log(all_results[[5]][pathways_of_interest,"oddsratio"],2),
pd.set=log(all_results[[6]][pathways_of_interest,"oddsratio"],2),
fd.set=log(all_results[[7]][pathways_of_interest,"oddsratio"],2),
cd.set=log(all_results[[8]][pathways_of_interest,"oddsratio"],2),
td.order=all_results[[9]][pathways_of_interest,"oddsratio"],
pd.order=all_results[[10]][pathways_of_interest,"oddsratio"],
fd.order=all_results[[11]][pathways_of_interest,"oddsratio"],
cd.order=all_results[[12]][pathways_of_interest,"oddsratio"],
td.corr=all_results[[13]][pathways_of_interest,"oddsratio"],
pd.corr=all_results[[14]][pathways_of_interest,"oddsratio"],
fd.corr=all_results[[15]][pathways_of_interest,"oddsratio"],
cd.corr=all_results[[16]][pathways_of_interest,"oddsratio"])
rownames(results.frame) = results.frame[,1]
rownames(results.frame.or) = results.frame.or[,1]
results.frame.sig = results.frame[,2:17]*results.frame.or[,2:17]
library(gplots)
heatmap.2(as.matrix(results.frame.sig[,c(1:4,9:16)]), Colv=NA, trace="none", breaks=c(-1,-.1,-0.0001,0,0.1,1), col=c("blue","lightblue", "grey","pink", "red"), dendrogram="none")
# this comparison of abundance in substrates between case and control
# is lopsided in the sense that phosphorylation levels were previously
# reported to be overall higher in the short survivors. Thus the
# results are not terribly interesting (all kinases are in the same direction)
phosphodata.ksea.comp.svl = leapR(geneset=kinasesubstrates,
enrichment_method="enrichment_comparison",
datamatrix=phosphodata,
primary_columns=shortlist, secondary_columns=longlist)
# thus for the example we'll look at correlation between known substrates in the
# case v control conditions
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
# thus for the example we'll look at correlation between known substrates in the
# case v control conditions
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
phosphodata[,shortlist]
phosphodata[,longlist]
source("R/correlation_comparison_enrichment.R")
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
source("R/correlation_comparison_enrichment.R")
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
devtools::install()
# this comparison of abundance in substrates between case and control
# is lopsided in the sense that phosphorylation levels were previously
# reported to be overall higher in the short survivors. Thus the
# results are not terribly interesting (all kinases are in the same direction)
phosphodata.ksea.comp.svl = leapR(geneset=kinasesubstrates,
enrichment_method="enrichment_comparison",
datamatrix=phosphodata,
primary_columns=shortlist, secondary_columns=longlist)
# thus for the example we'll look at correlation between known substrates in the
# case v control conditions
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
source("R/correlation_comparison_enrichment.R")
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
devtools::install()
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
cols1
cols2
abcols1
allallgenes_present
allgenes_present
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
allgenes
abundance[1:5,1:5]
ids
which(allgenes %in% ids)
allgenes
ids
allgenes
ids
allgenes
which(ids == "ADD1-S12")
which(ids == "CLK4S339")
which(ids == "CLK4-S339")
which(ids == "CLK4-S339")
ids[1]
which(ids == "AAAS-S495s")
ids
which(ids == "ANKS1A-S663s")
allgenes
kinasesubstrates
kinasesubstrates$matrix[1:10,1:10]
phosphodata[1:5,1:5]
sapply(rownames(phosphodata), function (n) substring(n, 1, length(n)-1)[1:5]
)
version()
sapply(rownames(phosphodata), function (n) substring(n, 1, length(n)-1))
sapply(rownames(phosphodata), function (n) substring(n, 1, len(n)-1))
sapply(rownames(phosphodata), function (n) substring(n, 1, nchar(n)-1)[1:5]
)
sapply(rownames(phosphodata), function (n) substring(n, 1, nchar(n)-1))[1:5]
rownames(phosphodata) = sapply(rownames(phosphodata), function (n) substring(n, 1, nchar(n)-1))[1:5]
rownames(phosphodata) = sapply(rownames(phosphodata), function (n) substring(n, 1, nchar(n)-1))
save(phosphodata, file="data/phosphodata.rda")
devtools::install()
# thus for the example we'll look at correlation between known substrates in the
# case v control conditions
phosphodata.ksea.corr.svl = leapR(geneset=kinasesubstrates,
enrichment_method="correlation_comparison",
datamatrix=phosphodata,
primary_columns=shortlist,
secondary_columns=longlist)
devtools::install_github("biodataganache/leapR")
devtools::install_github("biodataganache/leapR")
devtools::install_github("biodataganache/leapR")
devtools::install_github("biodataganache/leapR", force=TRUE)
devtools::install_github("biodataganache/leapR")
devtools::install_github("biodataganache/leapR")
devtools::install_github("biodataganache/leapR")
devtools::install_github("biodataganache/leapR")