-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeek 9-10 code
More file actions
141 lines (116 loc) · 5.21 KB
/
Copy pathWeek 9-10 code
File metadata and controls
141 lines (116 loc) · 5.21 KB
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
#WEEK 9-10
---
TITLE: "Oliwia's RNASeq notebook: part 6"
---
Gene ontology
---
RStudio info
---
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 1.3
year 2022
month 03
day 10
svn rev 81868
language R
version.string R version 4.1.3 (2022-03-10)
nickname One Push-Up
---
PART 1: RNASEQ GENE SET TESTING
---
References:
https://sbc.shef.ac.uk/workshops/2020-02-13-rnaseq-r/rna-seq-gene-set-testing.nb.html
https://bioinformatics-core-shared-training.github.io/RNAseq-R/rna-seq-gene-set-testing.nb.html
https://combine-australia.github.io/RNAseq-R/06-rnaseq-day1.html#Plots_after_testing_for_DE
Gene ontology (GO) testing with goana
#installing the package
```{r}
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("limma")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("org.Ce.eg.db")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("GO.db")
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("topGO")
```
#attach
```{r}
library(limma)
library(org.Ce.eg.db)
library(GO.db)
library(topGO)
```
#adding ENTREZID annotation to the table
```{r}
res2$ENTREZID = mapIds(org.Ce.eg.db,
key=res2$sequence_name,
column="ENTREZID",
keytype="WORMBASE",
multiVals="first")
```
#separation of + and - log2 fold change genes
```{r}
res2 <- mutate(res2, updown=ifelse(res2$log2FoldChange>0, "up", "down"))
res3 <- subset(res2, updown!="down" )
res3 = na.omit(res3)
res4 <- subset(res2, updown!="up" )
res4 = na.omit(res4)
```
#fixing the GO test to show up and down regulation
```{r}
IDs<-res2$ENTREZID
go <- goana(list(Up=res3$ENTREZID, Down=res4$ENTREZID), species="Ce")
topGO(go, n=10)
```
#different package could be explored for more possibilities with graphs
---
SESSION INFO
---
R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_Europe.1252 LC_CTYPE=English_Europe.1252 LC_MONETARY=English_Europe.1252
[4] LC_NUMERIC=C LC_TIME=English_Europe.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] MatrixGenerics_1.6.0 Biobase_2.54.0 httr_1.4.2
[4] bit64_4.0.5 splines_4.1.3 assertthat_0.2.1
[7] BiocManager_1.30.16 stats4_4.1.3 blob_1.2.2
[10] GenomeInfoDbData_1.2.7 yaml_2.3.5 pillar_1.7.0
[13] RSQLite_2.2.10 lattice_0.20-45 glue_1.6.1
[16] digest_0.6.29 GenomicRanges_1.46.1 RColorBrewer_1.1-2
[19] XVector_0.34.0 colorspace_2.0-3 htmltools_0.5.2
[22] Matrix_1.4-0 DESeq2_1.34.0 XML_3.99-0.8
[25] pkgconfig_2.0.3 genefilter_1.76.0 zlibbioc_1.40.0
[28] purrr_0.3.4 xtable_1.8-4 scales_1.1.1
[31] tzdb_0.2.0 BiocParallel_1.28.3 tibble_3.1.6
[34] annotate_1.72.0 KEGGREST_1.34.0 generics_0.1.2
[37] IRanges_2.28.0 ggplot2_3.3.5 ellipsis_0.3.2
[40] cachem_1.0.6 SummarizedExperiment_1.24.0 BiocGenerics_0.40.0
[43] cli_3.2.0 survival_3.2-13 magrittr_2.0.2
[46] crayon_1.5.0 memoise_2.0.1 evaluate_0.15
[49] fansi_1.0.2 tools_4.1.3 hms_1.1.1
[52] lifecycle_1.0.1 matrixStats_0.61.0 S4Vectors_0.32.3
[55] munsell_0.5.0 locfit_1.5-9.4 DelayedArray_0.20.0
[58] AnnotationDbi_1.56.2 Biostrings_2.62.0 compiler_4.1.3
[61] GenomeInfoDb_1.30.1 rlang_1.0.1 grid_4.1.3
[64] RCurl_1.98-1.6 rstudioapi_0.13 bitops_1.0-7
[67] rmarkdown_2.13 gtable_0.3.0 DBI_1.1.2
[70] R6_2.5.1 knitr_1.37 dplyr_1.0.8
[73] fastmap_1.1.0 bit_4.0.4 utf8_1.2.2
[76] readr_2.1.2 parallel_4.1.3 Rcpp_1.0.8
[79] vctrs_0.3.8 geneplotter_1.72.0 png_0.1-7
[82] tidyselect_1.1.2 xfun_0.29