library(limma)
library(Glimma)
library(edgeR)
library(Homo.sapiens)
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: ‘BiocGenerics’
The following objects are masked from ‘package:parallel’:
clusterApply, clusterApplyLB, clusterCall,
clusterEvalQ, clusterExport, clusterMap, parApply,
parCapply, parLapply, parLapplyLB, parRapply,
parSapply, parSapplyLB
The following object is masked from ‘package:limma’:
plotMA
The following objects are masked from ‘package:stats’:
IQR, mad, sd, var, xtabs
The following objects are masked from ‘package:base’:
anyDuplicated, append, as.data.frame, basename,
cbind, colnames, dirname, do.call, duplicated,
eval, evalq, Filter, Find, get, grep, grepl,
intersect, is.unsorted, lapply, Map, mapply, match,
mget, order, paste, pmax, pmax.int, pmin, pmin.int,
Position, rank, rbind, Reduce, rownames, sapply,
setdiff, sort, table, tapply, union, unique,
unsplit, which, which.max, which.min
Loading required package: Biobase
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages
'citation("pkgname")'.
Loading required package: IRanges
Loading required package: S4Vectors
Attaching package: ‘S4Vectors’
The following object is masked from ‘package:base’:
expand.grid
Loading required package: OrganismDbi
Loading required package: GenomicFeatures
Loading required package: GenomeInfoDb
Loading required package: GenomicRanges
Registered S3 method overwritten by 'dplyr':
method from
print.rowwise_df
Registered S3 methods overwritten by 'dbplyr':
method from
print.tbl_lazy
print.tbl_sql
Loading required package: GO.db
Loading required package: org.Hs.eg.db
Loading required package: TxDb.Hsapiens.UCSC.hg19.knownGene
files <- c("lungcancer1.txt", "lungcancer2.txt", "lungcancer3.txt", "lungcancer4.txt", "lungcancer5.txt","lungcancer6.txt", "lungcancer7.txt", "lungcancer8.txt", "lungcancer9.txt", "lungcancer10.txt", "lungcancer11.txt", "lungcancer12.txt", "lungcancer13.txt", "lungcancer14.txt", "lungcancer15.txt", "lungcancer16.txt", "lungcancer17.txt", "lungcancer18.txt", "lungcancer19.txt", "lungcancer20.txt", "lungcancer21.txt", "lungcancer22.txt", "lungcancer23.txt", "lungcancer24.txt", "lungcancer25.txt", "lungcancer26.txt", "lungcancer27.txt", "lungcancer28.txt", "lungcancer29.txt", "lungcancer30.txt", "normal1.txt", "normal2.txt", "normal3.txt", "normal4.txt", "normal5.txt", "normal6.txt", "normal7.txt", "normal8.txt", "normal9.txt", "normal10.txt", "normal11.txt", "normal12.txt", "normal13.txt", "normal14.txt", "normal15.txt", "normal16.txt", "normal17.txt", "normal18.txt", "normal19.txt", "normal20.txt", "normal21.txt", "normal22.txt", "normal23.txt", "normal24.txt", "normal25.txt", "normal26.txt", "normal27.txt", "normal28.txt", "normal29.txt", "normal30.txt")
read.delim(files[1], header=FALSE, nrow=5)
x <- readDGE(files)
Meta tags detected: __no_feature, __ambiguous, __too_low_aQual, __not_aligned, __alignment_not_unique
class(x)
[1] "DGEList"
attr(,"package")
[1] "edgeR"
dim(x)
[1] 60487 60
group <- as.factor(rep(c("lungcancer", "normal"), c(30, 30)))
x$samples$group <- group
x$samples
geneid <- rownames(x)
genes <- select(Homo.sapiens, keys=geneid, columns=c("SYMBOL", "TXCHROM"),
keytype="ENSEMBL")
'select()' returned 1:many mapping between keys and
columns
head(genes)
genes <- genes[!duplicated(genes$ENSEMBL),]
x$genes <- genes
x
An object of class "DGEList"
$samples
55 more rows ...
$counts
Samples
Tags lungcancer1 lungcancer2 lungcancer3
ENSG00000000005 0 149 4
ENSG00000000419 1642 1057 1203
ENSG00000000457 476 709 2049
ENSG00000000460 600 339 628
ENSG00000000938 909 884 1665
Samples
Tags lungcancer4 lungcancer5 lungcancer6
ENSG00000000005 0 0 4
ENSG00000000419 3790 2717 2765
ENSG00000000457 806 2289 2658
ENSG00000000460 652 1044 577
ENSG00000000938 254 4122 1216
Samples
Tags lungcancer7 lungcancer8 lungcancer9
ENSG00000000005 1 0 1
ENSG00000000419 2084 1798 858
ENSG00000000457 513 310 628
ENSG00000000460 708 162 368
ENSG00000000938 659 276 1325
Samples
Tags lungcancer10 lungcancer11 lungcancer12
ENSG00000000005 0 0 2
ENSG00000000419 770 1810 1465
ENSG00000000457 617 2159 2324
ENSG00000000460 189 372 598
ENSG00000000938 917 3947 1491
Samples
Tags lungcancer13 lungcancer14 lungcancer15
ENSG00000000005 7 24 2
ENSG00000000419 1705 557 4109
ENSG00000000457 1235 1030 1148
ENSG00000000460 344 583 765
ENSG00000000938 408 288 429
Samples
Tags lungcancer16 lungcancer17 lungcancer18
ENSG00000000005 10 0 0
ENSG00000000419 690 1032 1277
ENSG00000000457 933 710 555
ENSG00000000460 813 394 146
ENSG00000000938 135 725 1453
Samples
Tags lungcancer19 lungcancer20 lungcancer21
ENSG00000000005 8 0 2
ENSG00000000419 1295 1564 2105
ENSG00000000457 857 1384 471
ENSG00000000460 577 364 460
ENSG00000000938 860 426 437
Samples
Tags lungcancer22 lungcancer23 lungcancer24
ENSG00000000005 0 4 3
ENSG00000000419 2233 359 1071
ENSG00000000457 1285 708 784
ENSG00000000460 701 387 373
ENSG00000000938 1694 329 667
Samples
Tags lungcancer25 lungcancer26 lungcancer27
ENSG00000000005 0 2 3
ENSG00000000419 3158 608 2141
ENSG00000000457 2106 573 1350
ENSG00000000460 1289 349 595
ENSG00000000938 1349 242 1505
Samples
Tags lungcancer28 lungcancer29 lungcancer30
ENSG00000000005 0 1 129
ENSG00000000419 1708 1355 2988
ENSG00000000457 636 776 1117
ENSG00000000460 568 618 491
ENSG00000000938 558 575 1671
Samples
Tags normal1 normal2 normal3 normal4 normal5
ENSG00000000005 2 0 0 3 0
ENSG00000000419 914 572 1198 1210 784
ENSG00000000457 474 425 341 588 444
ENSG00000000460 80 87 85 115 82
ENSG00000000938 2132 1490 3396 4115 2432
Samples
Tags normal6 normal7 normal8 normal9 normal10
ENSG00000000005 7 9 0 1 1
ENSG00000000419 985 1993 759 711 800
ENSG00000000457 404 723 306 573 477
ENSG00000000460 82 185 44 98 78
ENSG00000000938 4468 12621 1526 2217 1855
Samples
Tags normal11 normal12 normal13 normal14 normal15
ENSG00000000005 1 0 0 1 1
ENSG00000000419 928 936 744 946 623
ENSG00000000457 286 573 487 660 497
ENSG00000000460 93 108 69 157 89
ENSG00000000938 3390 4933 3121 2994 1914
Samples
Tags normal16 normal17 normal18 normal19 normal20
ENSG00000000005 1 1 2 3 2
ENSG00000000419 1708 1094 794 1583 1003
ENSG00000000457 436 322 514 569 388
ENSG00000000460 141 78 167 98 74
ENSG00000000938 3798 2523 10160 1631 3617
Samples
Tags normal21 normal22 normal23 normal24 normal25
ENSG00000000005 0 0 2 2 5
ENSG00000000419 567 589 1691 940 1582
ENSG00000000457 381 361 505 441 936
ENSG00000000460 63 88 117 99 174
ENSG00000000938 2492 3095 1397 2574 3119
Samples
Tags normal26 normal27 normal28 normal29 normal30
ENSG00000000005 1 8 1 2 3
ENSG00000000419 1590 1040 945 1287 1111
ENSG00000000457 1182 670 337 483 838
ENSG00000000460 166 151 39 156 129
ENSG00000000938 4171 3275 2689 12472 3595
60482 more rows ...
$genes
60482 more rows ...
cpm <- cpm(x)
lcpm <- cpm(x, log=TRUE)
L <- mean(x$samples$lib.size) * 1e-6
M <- median(x$samples$lib.size) * 1e-6
c(L, M)
[1] 70.50792 60.36025
summary(lcpm)
lungcancer1 lungcancer2 lungcancer3
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-5.1397 Median :-4.4129 Median :-4.7616
Mean :-2.4484 Mean :-2.2363 Mean :-2.4086
3rd Qu.:-0.3864 3rd Qu.: 0.1929 3rd Qu.:-0.5151
Max. :18.4188 Max. :17.6028 Max. :17.8170
lungcancer4 lungcancer5 lungcancer6
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-5.1397 Median :-4.3387 Median :-4.5220
Mean :-2.5895 Mean :-2.1446 Mean :-2.3129
3rd Qu.:-0.6794 3rd Qu.: 0.4823 3rd Qu.:-0.1763
Max. :18.1849 Max. :17.7674 Max. :17.8613
lungcancer7 lungcancer8 lungcancer9
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.4120 Median :-5.1397 Median :-4.4790
Mean :-2.2870 Mean :-2.6295 Mean :-2.2202
3rd Qu.: 0.1475 3rd Qu.:-0.7495 3rd Qu.: 0.3567
Max. :18.1956 Max. :18.3183 Max. :18.1218
lungcancer10 lungcancer11 lungcancer12
Min. :-5.1397 Min. :-5.1397 Min. :-5.140
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.140
Median :-5.1397 Median :-4.4296 Median :-4.330
Mean :-2.4931 Mean :-2.2294 Mean :-2.117
3rd Qu.:-0.3855 3rd Qu.: 0.1515 3rd Qu.: 0.535
Max. :18.1696 Max. :17.8967 Max. :17.876
lungcancer13 lungcancer14 lungcancer15
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.7158 Median :-3.6226 Median :-4.7357
Mean :-2.4636 Mean :-2.3178 Mean :-2.3793
3rd Qu.:-0.4056 3rd Qu.:-0.1806 3rd Qu.:-0.3082
Max. :17.7640 Max. :19.0689 Max. :17.8489
lungcancer16 lungcancer17 lungcancer18
Min. :-5.1397 Min. :-5.140 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.140 1st Qu.:-5.1397
Median :-3.9055 Median :-4.524 Median :-4.4306
Mean :-2.4452 Mean :-2.419 Mean :-2.1800
3rd Qu.:-0.3437 3rd Qu.:-0.324 3rd Qu.: 0.3252
Max. :19.0036 Max. :18.271 Max. :17.6404
lungcancer19 lungcancer20 lungcancer21
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.5924 Median :-5.1397 Median :-4.5132
Mean :-2.3079 Mean :-2.5103 Mean :-2.3699
3rd Qu.:-0.1027 3rd Qu.:-0.7136 3rd Qu.:-0.4384
Max. :17.7442 Max. :17.7508 Max. :17.6826
lungcancer22 lungcancer23 lungcancer24
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.3238 Median :-3.8581 Median :-4.5356
Mean :-2.2036 Mean :-2.4982 Mean :-2.4192
3rd Qu.: 0.1742 3rd Qu.:-0.4975 3rd Qu.:-0.3303
Max. :18.3008 Max. :18.9217 Max. :17.9534
lungcancer25 lungcancer26 lungcancer27
Min. :-5.13971 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.13971 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.47408 Median :-5.1397 Median :-4.3855
Mean :-2.27434 Mean :-2.4775 Mean :-2.2377
3rd Qu.:-0.07201 3rd Qu.:-0.4987 3rd Qu.: 0.1625
Max. :18.03774 Max. :18.0625 Max. :17.9401
lungcancer28 lungcancer29 lungcancer30
Min. :-5.13971 Min. :-5.1397 Min. :-5.13971
1st Qu.:-5.13971 1st Qu.:-5.1397 1st Qu.:-5.13971
Median :-4.41830 Median :-4.5853 Median :-4.67953
Mean :-2.30899 Mean :-2.3161 Mean :-2.30530
3rd Qu.:-0.02131 3rd Qu.:-0.1013 3rd Qu.: 0.07241
Max. :18.20328 Max. :18.2217 Max. :17.94979
normal1 normal2 normal3
Min. :-5.13971 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.13971 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.31577 Median :-4.1469 Median :-4.4692
Mean :-2.30954 Mean :-2.2309 Mean :-2.3626
3rd Qu.: 0.01654 3rd Qu.: 0.2725 3rd Qu.:-0.1774
Max. :17.61455 Max. :17.6798 Max. :17.5069
normal4 normal5 normal6
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.4354 Median :-4.2578 Median :-4.5930
Mean :-2.2467 Mean :-2.2332 Mean :-2.4016
3rd Qu.: 0.1367 3rd Qu.: 0.1429 3rd Qu.:-0.3229
Max. :17.6399 Max. :17.5807 Max. :17.5106
normal7 normal8 normal9
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-4.7008 Median :-5.1397 Median :-4.2925
Mean :-2.4522 Mean :-2.3758 Mean :-2.1750
3rd Qu.:-0.3131 3rd Qu.:-0.2148 3rd Qu.: 0.3246
Max. :17.8212 Max. :17.7043 Max. :17.7287
normal10 normal11 normal12
Min. :-5.1397 Min. :-5.140 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.140 1st Qu.:-5.1397
Median :-4.2557 Median :-5.140 Median :-4.4254
Mean :-2.1937 Mean :-2.580 Mean :-2.3960
3rd Qu.: 0.3237 3rd Qu.:-0.609 3rd Qu.:-0.2723
Max. :17.4421 Max. :18.029 Max. :17.6686
normal13 normal14 normal15
Min. :-5.139713 Min. :-5.1397 Min. :-5.13971
1st Qu.:-5.139713 1st Qu.:-5.1397 1st Qu.:-5.13971
Median :-4.267647 Median :-4.5990 Median :-5.13971
Mean :-2.298557 Mean :-2.4283 Mean :-2.32478
3rd Qu.:-0.008716 3rd Qu.:-0.2064 3rd Qu.:-0.05412
Max. :17.616315 Max. :18.4995 Max. :17.38996
normal16 normal17 normal18
Min. :-5.1397 Min. :-5.1397 Min. :-5.13971
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.13971
Median :-5.1397 Median :-5.1397 Median :-4.43619
Mean :-2.5088 Mean :-2.5158 Mean :-2.30475
3rd Qu.:-0.4528 3rd Qu.:-0.5022 3rd Qu.:-0.01301
Max. :18.1094 Max. :17.9214 Max. :17.82915
normal19 normal20 normal21
Min. :-5.13971 Min. :-5.13971 Min. :-5.1397
1st Qu.:-5.13971 1st Qu.:-5.13971 1st Qu.:-5.1397
Median :-4.40829 Median :-4.37996 Median :-5.1397
Mean :-2.37241 Mean :-2.33435 Mean :-2.4028
3rd Qu.:-0.07993 3rd Qu.:-0.04068 3rd Qu.:-0.2864
Max. :17.78958 Max. :17.60441 Max. :17.7879
normal22 normal23 normal24
Min. :-5.13971 Min. :-5.1397 Min. :-5.13971
1st Qu.:-5.13971 1st Qu.:-5.1397 1st Qu.:-5.13971
Median :-5.13971 Median :-5.1397 Median :-4.36501
Mean :-2.33523 Mean :-2.5064 Mean :-2.26743
3rd Qu.:-0.06101 3rd Qu.:-0.3837 3rd Qu.: 0.05176
Max. :17.60888 Max. :18.1013 Max. :17.51707
normal25 normal26 normal27
Min. :-5.13971 Min. :-5.13971 Min. :-5.1397
1st Qu.:-5.13971 1st Qu.:-5.13971 1st Qu.:-5.1397
Median :-4.68797 Median :-4.66012 Median :-4.6247
Mean :-2.31576 Mean :-2.24928 Mean :-2.4158
3rd Qu.:-0.06399 3rd Qu.: 0.08062 3rd Qu.:-0.2454
Max. :17.77167 Max. :17.63736 Max. :18.2850
normal28 normal29 normal30
Min. :-5.1397 Min. :-5.1397 Min. :-5.1397
1st Qu.:-5.1397 1st Qu.:-5.1397 1st Qu.:-5.1397
Median :-5.1397 Median :-4.6548 Median :-4.5068
Mean :-2.4213 Mean :-2.4837 Mean :-2.2729
3rd Qu.:-0.3966 3rd Qu.:-0.5686 3rd Qu.: 0.1857
Max. :17.5366 Max. :17.6376 Max. :17.4832
table(rowSums(x$counts==0)==9)
FALSE TRUE
60080 407
keep.exprs <- filterByExpr(x, group=group)
x <- x[keep.exprs,, keep.lib.sizes=FALSE]
dim(x)
[1] 20164 60
x <- calcNormFactors(x, method = "TMM")
x$samples$norm.factors
[1] 0.9185598 1.2520071 0.9770007 0.7791732 1.2689106
[6] 1.0520060 1.1080997 0.6896731 1.0707238 0.9447171
[11] 1.1987867 1.1988755 1.0017946 0.4386081 0.9919776
[16] 0.3865567 0.9682403 1.2093979 1.0593485 0.9745016
[21] 1.0768749 0.9919688 0.3941130 1.0714011 1.0307585
[26] 0.9938045 1.1356022 1.0573511 0.9929259 1.0525792
[31] 1.1546160 1.1927018 1.0390981 1.1751071 1.2247732
[36] 0.9733427 0.9559141 1.1014620 1.2847027 1.2553682
[41] 0.8500888 1.0524942 1.1432055 0.9056096 1.1722588
[46] 0.9248401 0.9252950 1.0434931 1.0610241 1.0725026
[51] 1.0428680 1.1081053 0.9007192 1.1613340 1.0726913
[56] 1.1901319 0.9766712 1.0050588 0.9469542 1.2103739
x2 <- x
x2$samples$norm.factors <- 1
x2$counts[,1] <- ceiling(x2$counts[,1]*0.05)
x2$counts[,2] <- x2$counts[,2]*5
lcpm <- cpm(x2, log=TRUE)
boxplot(lcpm, las=2, col=col, main="")
title(main="A. Example: Unnormalised data",ylab="Log-cpm")
x2 <- calcNormFactors(x2)
x2$samples$norm.factors
[1] 0.05381085 6.11132763 1.02740275 0.84159443 1.25581956
[6] 1.10391022 1.19565619 0.73004963 1.07653619 0.92636852
[11] 1.19962441 1.21019482 1.02434191 0.43507458 1.04452001
[16] 0.39687114 0.99003244 1.19880060 1.11263982 1.06495758
[21] 1.16194042 1.02335871 0.39285194 1.09300075 1.07721647
[26] 1.02232768 1.19105748 1.11430645 1.03137893 1.09849045
[31] 1.17554277 1.20342513 1.08168382 1.17029389 1.21820178
[36] 0.99411478 0.97076325 1.12839074 1.29934792 1.30732156
[41] 0.84469066 1.05856585 1.12195954 0.89696846 1.20005423
[46] 0.93300547 0.90627737 1.01563315 1.09932560 1.08666277
[51] 1.05608075 1.09294837 0.92288629 1.19789703 1.09195944
[56] 1.21225233 0.99079843 1.02877126 0.95925494 1.23762292
lcpm <- cpm(x2, log=TRUE)
boxplot(lcpm, las=2, col=col, main="")
title(main="B. Example: Normalised data",ylab="Log-cpm")
lcpm <- cpm(x, log=TRUE)
plotMDS(lcpm, col = rep(c('red', 'blue'), each = 30))
title(main="Sample groups")
design <- model.matrix(~0+group)
colnames(design) <- gsub("group", "", colnames(design))
design
lungcancer normal
1 1 0
2 1 0
3 1 0
4 1 0
5 1 0
6 1 0
7 1 0
8 1 0
9 1 0
10 1 0
11 1 0
12 1 0
13 1 0
14 1 0
15 1 0
16 1 0
17 1 0
18 1 0
19 1 0
20 1 0
21 1 0
22 1 0
23 1 0
24 1 0
25 1 0
26 1 0
27 1 0
28 1 0
29 1 0
30 1 0
31 0 1
32 0 1
33 0 1
34 0 1
35 0 1
36 0 1
37 0 1
38 0 1
39 0 1
40 0 1
41 0 1
42 0 1
43 0 1
44 0 1
45 0 1
46 0 1
47 0 1
48 0 1
49 0 1
50 0 1
51 0 1
52 0 1
53 0 1
54 0 1
55 0 1
56 0 1
57 0 1
58 0 1
59 0 1
60 0 1
attr(,"assign")
[1] 1 1
attr(,"contrasts")
attr(,"contrasts")$group
[1] "contr.treatment"
contr.matrix <- makeContrasts(
LungcancervsNormal = lungcancer-normal,
levels = colnames(design))
contr.matrix
Contrasts
Levels LungcancervsNormal
lungcancer 1
normal -1
par(mfrow=c(1,2))
v <- voom(x, design, plot=TRUE)
v
An object of class "EList"
$genes
20159 more rows ...
$targets
55 more rows ...
$E
Samples
Tags lungcancer1 lungcancer2 lungcancer3
ENSG00000000419 5.195389 3.974058 3.393198
ENSG00000000457 3.410044 3.398275 4.161234
ENSG00000000460 3.743732 2.334884 2.455946
ENSG00000000938 4.342641 3.716335 3.861917
ENSG00000000971 5.278168 5.259933 5.626126
Samples
Tags lungcancer4 lungcancer5 lungcancer6
ENSG00000000419 6.596469 3.912970 4.318709
ENSG00000000457 4.363827 3.665723 4.261781
ENSG00000000460 4.058131 2.533502 2.059061
ENSG00000000938 2.699819 4.514209 3.133905
ENSG00000000971 5.643830 5.041031 5.797993
Samples
Tags lungcancer7 lungcancer8 lungcancer9
ENSG00000000419 5.138410 5.443621 3.726617
ENSG00000000457 3.117145 2.909492 3.276712
ENSG00000000460 3.581549 1.975338 2.506463
ENSG00000000938 3.478154 2.742178 4.353264
ENSG00000000971 3.914633 3.822102 5.348630
Samples
Tags lungcancer10 lungcancer11 lungcancer12
ENSG00000000419 4.062863 3.769959 3.710423
ENSG00000000457 3.743508 4.024269 4.375951
ENSG00000000460 2.039266 1.488884 2.418454
ENSG00000000938 4.314777 4.894511 3.735794
ENSG00000000971 6.546852 5.286941 3.471115
Samples
Tags lungcancer13 lungcancer14 lungcancer15
ENSG00000000419 4.045524 3.492339 5.253929
ENSG00000000457 3.580424 4.378640 3.414717
ENSG00000000460 1.737905 3.558100 2.829441
ENSG00000000938 1.983737 2.541938 1.995697
ENSG00000000971 5.822902 5.441978 4.178811
Samples
Tags lungcancer16 lungcancer17 lungcancer18
ENSG00000000419 3.784769 4.011404 4.251902
ENSG00000000457 4.219778 3.472169 3.050438
ENSG00000000460 4.021270 2.623360 1.127551
ENSG00000000938 1.435421 3.502310 4.438110
ENSG00000000971 6.769937 5.648510 6.675420
Samples
Tags lungcancer19 lungcancer20 lungcancer21
ENSG00000000419 4.003215 4.408202 4.917037
ENSG00000000457 3.407914 4.231866 2.758204
ENSG00000000460 2.837599 2.306491 2.724147
ENSG00000000938 3.412953 2.533118 2.650229
ENSG00000000971 4.284600 5.329803 4.863287
Samples
Tags lungcancer22 lungcancer23 lungcancer24
ENSG00000000419 4.605103 3.217439 3.884100
ENSG00000000457 3.808126 4.196215 3.434314
ENSG00000000460 2.934312 3.325644 2.363649
ENSG00000000938 4.206656 3.091726 3.201308
ENSG00000000971 4.548455 7.163912 5.079310
Samples
Tags lungcancer25 lungcancer26 lungcancer27
ENSG00000000419 4.673794 3.594560 4.202205
ENSG00000000457 4.089403 3.509096 3.537077
ENSG00000000460 3.381367 2.794595 2.355756
ENSG00000000938 3.446980 2.267288 3.693826
ENSG00000000971 6.663883 6.812670 7.178645
Samples
Tags lungcancer28 lungcancer29 lungcancer30
ENSG00000000419 4.897766 4.185069 4.922611
ENSG00000000457 3.473268 3.381302 3.503465
ENSG00000000460 3.310268 3.053090 2.318453
ENSG00000000938 3.284665 2.949132 4.084333
ENSG00000000971 5.603490 6.310988 6.370078
Samples
Tags normal1 normal2 normal3 normal4
ENSG00000000419 4.1142343 3.754496 4.2762034 4.2024915
ENSG00000000457 3.1676592 3.326379 2.4649310 3.1620027
ENSG00000000460 0.6083118 1.044575 0.4670418 0.8128531
ENSG00000000938 5.3357249 5.134944 5.7790224 5.9679561
ENSG00000000971 5.0979728 5.540635 5.7959135 5.3928628
Samples
Tags normal5 normal6 normal7 normal8
ENSG00000000419 3.9380962 3.7271642 4.3953483 4.5239313
ENSG00000000457 3.1185062 2.4424480 2.9331096 3.2147684
ENSG00000000460 0.6887888 0.1487743 0.9695358 0.4307586
ENSG00000000938 5.5706906 5.9080270 7.0578562 5.5310370
ENSG00000000971 5.9924588 6.0056997 5.8551417 5.4036577
Samples
Tags normal9 normal10 normal11 normal12
ENSG00000000419 3.6514312 3.9363717 4.563042 4.0164876
ENSG00000000457 3.3403609 3.1909710 2.866675 3.3090021
ENSG00000000460 0.7987631 0.5862348 1.251179 0.9069036
ENSG00000000938 5.2914296 5.1492064 6.431566 6.4137482
ENSG00000000971 5.8647429 6.1648659 5.298142 4.6674435
Samples
Tags normal13 normal14 normal15 normal16
ENSG00000000419 3.9401747 3.753783 3.7890487 4.757087
ENSG00000000457 3.3293051 3.234740 3.4633557 2.788410
ENSG00000000460 0.5189878 1.166533 0.9886187 1.163231
ENSG00000000938 6.0080705 5.415424 5.4075549 5.909787
ENSG00000000971 5.1326381 4.925655 6.2456378 6.716952
Samples
Tags normal17 normal18 normal19 normal20
ENSG00000000419 4.7898488 3.764240 4.8061615 4.2025251
ENSG00000000457 3.0269479 3.137363 3.3308124 2.8334710
ENSG00000000460 0.9884133 1.518353 0.7993122 0.4508687
ENSG00000000938 5.9950029 7.441020 4.8492436 6.0524775
ENSG00000000971 5.7782688 4.334296 6.1973722 5.5818107
Samples
Tags normal21 normal22 normal23 normal24
ENSG00000000419 3.8447867 3.951982 5.045349 4.0309506
ENSG00000000457 3.2718493 3.246485 3.302829 2.9399361
ENSG00000000460 0.6849948 1.216239 1.197779 0.7902911
ENSG00000000938 5.9796879 6.344590 4.769894 5.4837430
ENSG00000000971 4.9400791 5.441685 5.944000 5.6250877
Samples
Tags normal25 normal26 normal27 normal28
ENSG00000000419 3.9447405 3.9031302 3.6971826 4.339643
ENSG00000000457 3.1878859 3.4754900 3.0632148 2.853453
ENSG00000000460 0.7638339 0.6472439 0.9172953 -0.241510
ENSG00000000938 4.9238498 5.2942161 5.3516208 5.847832
ENSG00000000971 5.5573930 5.2669848 6.9543846 4.794003
Samples
Tags normal29 normal30
ENSG00000000419 3.9463366 3.8434428
ENSG00000000457 2.5333519 3.4368176
ENSG00000000460 0.9059987 0.7419589
ENSG00000000938 7.2224429 5.5371273
ENSG00000000971 6.0608653 5.5403337
20159 more rows ...
$weights
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 2.270024 2.496418 2.621039 2.175041 2.576277 2.618005
[2,] 1.935153 2.240671 2.529374 1.829905 2.621447 2.585667
[3,] 1.447015 1.725194 2.134462 1.368076 2.430483 2.270891
[4,] 1.762298 2.077245 2.431065 1.661696 2.593445 2.516402
[5,] 2.612832 2.604796 2.468150 2.589811 2.315432 2.405212
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 2.436873 2.214771 2.481880 2.289495 2.620492 2.619192
[2,] 2.147707 1.871961 2.215756 1.957582 2.574883 2.520197
[3,] 1.631139 1.398691 1.697460 1.464377 2.241279 2.117629
[4,] 1.979322 1.700996 2.048464 1.783514 2.499231 2.419690
[5,] 2.619717 2.600040 2.609079 2.615087 2.419705 2.475627
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 2.612711 2.335689 2.616073 2.342516 2.476526 2.495002
[2,] 2.488252 2.013013 2.504769 2.021536 2.207177 2.238237
[3,] 2.056208 1.510034 2.088979 1.517344 1.687951 1.722477
[4,] 2.374019 1.839312 2.400050 1.848246 2.038577 2.074428
[5,] 2.500798 2.620872 2.488320 2.621779 2.610570 2.605211
[,19] [,20] [,21] [,22] [,23] [,24]
[1,] 2.560921 2.532558 2.510291 2.592711 2.164965 2.526447
[2,] 2.360025 2.303332 2.264602 2.431668 1.819427 2.292664
[3,] 1.865951 1.793863 1.751764 1.965781 1.360560 1.782232
[4,] 2.213642 2.144939 2.104065 2.300958 1.652059 2.133670
[5,] 2.568964 2.588167 2.599411 2.535982 2.587265 2.591234
[,25] [,26] [,27] [,28] [,29] [,30]
[1,] 2.621856 2.345815 2.622290 2.420909 2.537091 2.606326
[2,] 2.554231 2.025659 2.535608 2.123989 2.311122 2.467401
[3,] 2.192416 1.520883 2.145948 1.608390 1.802532 2.020130
[4,] 2.469882 1.852570 2.438801 1.953336 2.153327 2.345176
[5,] 2.443165 2.622217 2.463106 2.620561 2.585900 2.514919
[,31] [,32] [,33] [,34] [,35] [,36]
[1,] 2.2851589 2.1286048 2.384807 2.418627 2.2635540 2.480168
[2,] 1.7549531 1.5950078 1.877135 1.924493 1.7313166 2.020883
[3,] 0.9605529 0.9010445 1.008270 1.027718 0.9515763 1.069986
[4,] 2.6124926 2.6225583 2.587951 2.575698 2.6161255 2.544613
[5,] 2.6211065 2.6127272 2.608314 2.600288 2.6217156 2.575367
[,37] [,38] [,39] [,40] [,41]
[1,] 2.566003 1.9361779 2.3306602 2.2783152 2.0707742
[2,] 2.203554 1.4323353 1.8080111 1.7476176 1.5426758
[3,] 1.161630 0.8433382 0.9809907 0.9577096 0.8823336
[4,] 2.472682 2.5907752 2.6044002 2.6136380 2.6163663
[5,] 2.510557 2.5594941 2.6185878 2.6212987 2.6006400
[,42] [,43] [,44] [,45] [,46] [,47]
[1,] 2.3438316 2.2269608 2.451042 2.1743579 2.398040 2.0764738
[2,] 1.8249449 1.6909754 1.976565 1.6383488 1.893429 1.5475329
[3,] 0.9875602 0.9364991 1.049582 0.9170745 1.014977 0.8840805
[4,] 2.6014096 2.6203823 2.559832 2.6217978 2.583684 2.6169512
[5,] 2.6160566 2.6227645 2.587169 2.6176610 2.605854 2.6020333
[,48] [,49] [,50] [,51] [,52]
[1,] 2.3501718 2.3304304 2.3073262 2.0751043 2.046896
[2,] 1.8331239 1.8077164 1.7787885 1.5463657 1.522374
[3,] 0.9907588 0.9808777 0.9697618 0.8836609 0.874997
[4,] 2.5993022 2.6044442 2.6088160 2.6168108 2.613896
[5,] 2.6148456 2.6186321 2.6204892 2.6016989 2.594760
[,53] [,54] [,55] [,56] [,57] [,58]
[1,] 2.2641282 2.3403305 2.587225 2.593683 2.509787 2.2007825
[2,] 1.7319526 1.8204360 2.259022 2.282408 2.078887 1.6632551
[3,] 0.9518149 0.9857948 1.195769 1.210655 1.097074 0.9262997
[4,] 2.6160283 2.6025523 2.446277 2.435164 2.523853 2.6211208
[5,] 2.6216993 2.6167274 2.486017 2.474915 2.556785 2.6204569
[,59] [,60]
[1,] 2.525866 2.495780
[2,] 2.109415 2.051308
[3,] 1.112132 1.084068
[4,] 2.511695 2.534401
[5,] 2.546362 2.565977
20159 more rows ...
$design
lungcancer normal
1 1 0
2 1 0
3 1 0
4 1 0
5 1 0
55 more rows ...
vfit <- lmFit(v, design)
vfit <- contrasts.fit(vfit, contrasts=contr.matrix)
efit <- eBayes(vfit)
plotSA(efit, main="Final model: Mean-variance trend")
summary(decideTests(efit))
LungcancervsNormal
Down 5528
NotSig 9049
Up 5587
tfit <- treat(vfit, lfc=1)
dt <- decideTests(tfit)
summary(dt)
LungcancervsNormal
Down 1589
NotSig 17903
Up 672
lungcancer.vs.normal <- topTreat(tfit, coef=1, n=Inf)
head(lungcancer.vs.normal)
plotMD(tfit, column=1, status=dt[,1], main=colnames(tfit)[1],
xlim=c(-8,13))
glMDPlot(tfit, coef=1, status=dt, main=colnames(tfit)[1],
side.main="ENSEMBL", counts=lcpm, groups=group, launch=FALSE)
##Unknown issue
library(gplots)
lungcancer.vs.normal.topgenes <- lungcancer.vs.normal$ENSEMBL[1:100]
i <- which(v$genes$ENSEMBL %in% lungcancer.vs.normal.topgenes)
mycol <- colorpanel(1000,"blue","white","red")
heatmap.2(lcpm[i,], scale="row",
labRow=v$genes$SYMBOL[i], labCol=group,
col=mycol, trace="none", density.info="none",
margin=c(6,8), lhei=c(2,10), dendrogram="column")
Error in plot.new() : figure margins too large