In todays session we will work with some of the RNAseq data of adult mouse tissues from Bing Ren’s lab, Liver and Heart.

Exercises

1. goseq cellular component analysis

Identify GO term cellular component groups enriched in genes significantly upregulated in Liver with goseq. What are the top 5 terms?

HINT: Use “GO:CC” as the test category for goseq

## Can't find mm10/knownGene length data in genLenDataBase...
## Found the annotation package, TxDb.Mmusculus.UCSC.mm10.knownGene
## Trying to get the gene lengths from it.

## Fetching GO annotations...
## For 289 genes, we could not find any categories. These genes will be excluded.
## To force their use, please run with use_genes_without_cat=TRUE (see documentation).
## This was the default behavior for version 1.15.1 and earlier.
## Calculating the p-values...
## 'select()' returned 1:1 mapping between keys and columns
##        category over_represented_pvalue under_represented_pvalue numDEInCat
## 259  GO:0005783            1.262910e-38                        1        480
## 168  GO:0005615            1.441967e-31                        1        329
## 147  GO:0005576            3.411939e-26                        1        420
## 255  GO:0005777            2.214583e-19                        1         71
## 1041 GO:0042579            2.214583e-19                        1         71
##      numInCat                  term ontology
## 259      1622 endoplasmic reticulum       CC
## 168      1047   extracellular space       CC
## 147      1536  extracellular region       CC
## 255       140            peroxisome       CC
## 1041      140             microbody       CC

2. ClusterProfiler for KEGG enrichment

Plot the -log10 pvalue for top 5 terms as point plot.

HINT: The “gseKEGG” is the clusterPorfiler function for looking at KEGG terms

## preparing geneSet collections...
## GSEA analysis...
## leading edge analysis...
## done...
##                ID                         Description setSize enrichmentScore
## mmu00190 mmu00190           Oxidative phosphorylation     111       0.7303096
## mmu00830 mmu00830                  Retinol metabolism      81      -0.7868858
## mmu04260 mmu04260          Cardiac muscle contraction      78       0.7853715
## mmu05415 mmu05415             Diabetic cardiomyopathy     180       0.7332201
## mmu00140 mmu00140        Steroid hormone biosynthesis      71      -0.7974849
## mmu04610 mmu04610 Complement and coagulation cascades      86      -0.7545846
##                NES       pvalue     p.adjust      qvalues rank
## mmu00190  2.753080 1.000000e-19 8.225000e-18 4.763158e-18 2500
## mmu00830 -2.763184 1.000000e-19 8.225000e-18 4.763158e-18 2570
## mmu04260  2.783327 1.000000e-19 8.225000e-18 4.763158e-18 1875
## mmu05415  2.917856 1.000000e-19 8.225000e-18 4.763158e-18 2319
## mmu00140 -2.728415 1.149096e-18 7.561054e-17 4.378662e-17 1346
## mmu04610 -2.665677 3.676729e-18 2.016073e-16 1.167523e-16 1204
##                            leading_edge
## mmu00190 tags=69%, list=16%, signal=59%
## mmu00830 tags=79%, list=16%, signal=67%
## mmu04260 tags=58%, list=12%, signal=51%
## mmu05415 tags=63%, list=15%, signal=54%
## mmu00140  tags=66%, list=8%, signal=61%
## mmu04610  tags=56%, list=8%, signal=52%
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             core_enrichment
## mmu00190                                                                                                                                                                                                                            12865/12862/12858/17992/12869/28080/228033/11947/11946/22273/68342/12859/67264/66576/12857/11951/66445/69875/226646/11949/67680/12856/12866/17995/68198/11958/57423/68202/78330/407785/66108/68349/70383/75406/17993/66916/66046/84682/17991/67273/66377/66218/110323/76252/68197/104130/230075/11950/66152/54405/225887/227197/66091/407790/66142/72900/66043/66416/67126/71679/66414/68375/67003/66945/66694/11957/595136/66925/13063/70316/66052/67184/66495/73834/74776/66594/11984
## mmu00830                                                                                                                                                                                                                                                                                      72082/241452/394432/546726/216453/337924/100041375/20148/28200/13098/11529/404195/98711/26358/13082/72094/666168/71773/63857/13095/394434/56388/100727/22236/22238/433247/100040843/54150/13112/394433/112417/79235/100559/231396/107141/103142/67442/11532/17252/11761/13086/216454/13099/13097/394436/94284/27400/19683/13118/26876/11522/13119/11668/13113/243085/13096/13117/226143/13087/13085/277753/13077/226105/71724
## mmu04260                                                                                                                                                                                                                                                                                                                                                                                                                                   22003/17888/11464/12865/20191/140781/21924/11938/98660/12288/20541/17906/21956/76757/21954/17897/12293/12862/12373/12296/15464/12858/12869/11932/22273/12859/326618/66576/12857/66445/22004/11931/12866/84682/17896/110323/65973/66152/66142/53313/12292/12295/67003/66694/11928
## mmu05415 11739/18821/12865/20191/11938/12491/12895/20528/27273/21954/12862/11421/12858/14936/210789/18798/17992/12869/28080/228033/17390/11947/21809/11946/22273/68342/14584/18127/12859/67264/66576/12842/12843/22334/12857/11951/108058/66445/69875/226646/26414/11949/67680/12866/17995/23797/68198/68202/12322/78330/407785/66108/68349/18597/75406/17993/29857/66916/66046/84682/17991/67273/66377/66218/12825/13057/110323/19046/22333/68197/104130/230075/11950/18710/66152/105675/21808/54405/225887/227197/66091/407790/55951/66142/53313/72900/66043/13033/66416/21813/19045/67126/22335/71679/66414/68263/68375/67003/66945/66694/18604/11957/595136/11651/66925/21803/70316/66052/67184/66495/70456/12325/18752
## mmu00140                                                                                                                                                                                                                                                                                                                                                                                                          15494/72094/13074/380997/71773/545123/13095/394434/56388/100727/22236/22238/433247/56448/13112/394433/112417/13106/100559/231396/13101/107141/223706/15490/15493/71754/56348/13099/13097/394436/94284/27400/13113/12846/243085/78925/13096/13123/208665/226143/15483/15486/13077/226105/13122/76279/13105
## mmu04610                                                                                                                                                                                                                                                                                                                                                                                                             14058/16415/20702/110382/99571/14161/56373/19123/20701/14069/12258/17174/12263/625018/12266/14068/50909/50702/109821/545366/50908/110135/14060/16644/15160/385643/12274/20700/20704/14061/12269/17175/18815/12268/20703/14067/11905/17194/14071/230558/12279/58992/12630/15139/69379/14962/18816/22370

3. Dotplot

Show dotplot of the clusterProfiler results. Show the top 20 terms.

4. Enrichment Map

Show emap of the clusterProfiler results. Show the top 20 terms.

5. Heatmap of Leading Edge Genes

Draw a heatmap of the genes driving enrichment in the top 3 KEGG terms. Use rlog counts, scale across row using a Z-score and include the kidney data as a reference point.

HINT - The gene IDs are in the core_enrichment column of the clusterProfiler result

## renaming the first element in assays to 'counts'
## Warning in DESeqDataSet(geneCounts, design = ~Tissue): some variables in design
## formula are characters, converting to factors
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing