Skip to content

Commit c12148b

Browse files
committed
Rebuilt second vignette and added it to package.
1 parent d7afb46 commit c12148b

5 files changed

Lines changed: 494 additions & 415 deletions

File tree

.Rbuildignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
^doc$
88
^Meta$
99
^exampledata$
10-
^vignettes/IntegratingMultiomics\.Rmd$

vignettes/IntegratingMultiomics.R

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
## ----options, include = FALSE-------------------------------------------------
2+
knitr::opts_chunk$set(
3+
collapse = TRUE,
4+
comment = "##>"
5+
)
6+
7+
## ----bulkAnalyseR, include=FALSE----------------------------------------------
8+
library("bulkAnalyseR")
9+
10+
## ----load Yang 2019 mRNAseq---------------------------------------------------
11+
exp.yang <- read.csv(
12+
system.file("extdata", "expression_matrix_preprocessed.csv", package = "bulkAnalyseR"),
13+
row.names = 1) %>% as.matrix
14+
head(exp.yang)
15+
16+
## ----metadata-----------------------------------------------------------------
17+
meta <- data.frame(
18+
srr = colnames(exp.yang),
19+
timepoint = rep(c("0h", "12h", "36h"), each = 2)
20+
)
21+
22+
## ----convert type, include = FALSE, eval = FALSE------------------------------
23+
# meta$srr = as.character(meta$srr)
24+
# meta$timepoint = as.character(meta$timepoint)
25+
26+
## ----str gene expression------------------------------------------------------
27+
str(exp.yang)
28+
str(meta)
29+
30+
## ----gene table coord---------------------------------------------------------
31+
gene.coord.table <- read.csv(
32+
url('https://raw.githubusercontent.com/Core-Bioinformatics/bulkAnalyseR/master/exampledata/Yang2019_ChIP/gene_coords_GRCm38.p6.csv'),
33+
row.names = 1)
34+
str(gene.coord.table)
35+
36+
## ----chip coord table---------------------------------------------------------
37+
chip.coord.table <- read.csv(
38+
url('https://raw.githubusercontent.com/Core-Bioinformatics/bulkAnalyseR/master/exampledata/Yang2019_ChIP/ChIP_peak_coords.csv'),
39+
row.names = 1)
40+
str(chip.coord.table)
41+
42+
## -----------------------------------------------------------------------------
43+
cis.integration <- tibble::tibble(
44+
reference.expression.matrix = 'exp.yang',
45+
reference.org.db = 'org.Mm.eg.db',
46+
reference.coord = 'gene.coord.table',
47+
comparison.coord = 'chip.coord.table',
48+
reference.table.name = 'mRNAseq',
49+
comparison.table.name = 'ChIPseq'
50+
)
51+
52+
## ----generate cis app, eval=FALSE---------------------------------------------
53+
# generateShinyApp(
54+
# expression.matrix = exp.yang,
55+
# metadata = meta,
56+
# modality = "RNA",
57+
# shiny.dir = "shiny_Yang2019_CisIntegration",
58+
# app.title = "Shiny app for visualisation of three timepoints from the Yang 2019 data",
59+
# organism = "mmusculus",
60+
# org.db = "org.Mm.eg.db",
61+
# cis.integration = cis.integration
62+
# )
63+
# shiny::runApp('shiny_Yang2019_CisIntegration')
64+
65+
## ----CisIntegration, echo = FALSE, out.width = "80%"--------------------------
66+
knitr::include_graphics("figures/CisIntegrationExample.png")
67+
68+
## ----yang multiple modality, eval= FALSE--------------------------------------
69+
# exp.chip <- read.csv(
70+
# url('https://raw.githubusercontent.com/Core-Bioinformatics/bulkAnalyseR/master/exampledata/Yang2019_ChIP/ChIP_expression_matrix_preprocessed.csv'),
71+
# row.names = 1) %>% as.matrix
72+
# meta.chip = data.frame(
73+
# id = colnames(exp.chip),
74+
# timepoint = c('0h','12h','36h')
75+
# )
76+
# cis.integration.2 <- tibble::tibble(
77+
# reference.expression.matrix = c('exp.yang','exp.chip'),
78+
# reference.org.db = c('org.Mm.eg.db','NULL'),
79+
# reference.coord = c('gene.coord.table','chip.coord.table'),
80+
# comparison.coord = c('chip.coord.table','gene.coord.table'),
81+
# reference.table.name = c('mRNAseq','ChIPseq'),
82+
# comparison.table.name = c('ChIPseq','mRNAseq')
83+
# )
84+
# generateShinyApp(
85+
# expression.matrix = list(exp.yang,exp.chip),
86+
# metadata = list(meta,meta.chip),
87+
# modality = c('RNA','ChIP'),
88+
# shiny.dir = "shiny_Yang2019_CisIntegration2",
89+
# app.title = "Shiny app for visualisation of three timepoints from the Yang 2019 data",
90+
# organism = list("mmusculus",NA),
91+
# org.db = list("org.Mm.eg.db",NA),
92+
# cis.integration = cis.integration.2
93+
# )
94+
# shiny::runApp('shiny_Yang2019_CisIntegration2')
95+
96+
## ----li data------------------------------------------------------------------
97+
exp.mirna <- read.csv(
98+
url('https://raw.githubusercontent.com/Core-Bioinformatics/bulkAnalyseR/master/exampledata/Li2021_miRNA_mRNA/expression_matrix_miRNA_preprocessed.csv'),
99+
row.names = 1) %>% as.matrix
100+
str(exp.mirna)
101+
exp.mrna <- read.csv(
102+
url('https://raw.githubusercontent.com/Core-Bioinformatics/bulkAnalyseR/master/exampledata/Li2021_miRNA_mRNA/expression_matrix_mRNA_preprocessed.csv'),
103+
row.names = 1) %>% as.matrix
104+
str(exp.mrna)
105+
meta.trans = data.frame(id = paste0(rep(c('control_','IDD_'),each = 3),1:3),
106+
rep = rep(1:3,2),
107+
type = rep(c('control','IDD'),each = 3))
108+
meta.trans
109+
110+
## ----li trans app, eval=FALSE-------------------------------------------------
111+
# generateShinyApp(
112+
# shiny.dir = 'shiny_Li_2021',
113+
# app.title = 'Li 2021 Trans Regulatory Example',
114+
# modality=list('mRNA','miRNA'),
115+
# metadata = meta.trans,
116+
# expression.matrix = list(exp.mrna,exp.mirna),
117+
# org.db = list('org.Hs.eg.db',NA),
118+
# organism=list('hsapiens',NA),
119+
# trans.integration = tibble::tibble(
120+
# reference.expression.matrix='exp.mrna',
121+
# reference.org.db='org.Hs.eg.db',
122+
# comparison.expression.matrix='exp.mirna',
123+
# comparison.org.db='NULL',
124+
# reference.table.name='mRNA',
125+
# comparison.table.name='miRNA'
126+
# )
127+
# )
128+
# shiny::runApp('shiny_Li_2021')
129+
130+
## ----TransIntegration, echo = FALSE, out.width = "80%"------------------------
131+
knitr::include_graphics("figures/TransIntegrationExample.png")
132+
133+
## ---- messages = FALSE, eval = FALSE------------------------------------------
134+
# mirtarbase.comparison.table <- preprocess_miRTarBase(organism.code = 'mmu', org.db = 'org.Mm.eg.db')
135+
136+
## ---- messages=FALSE, eval=FALSE----------------------------------------------
137+
# mirtarbase.comparison.table <- preprocess_miRTarBase(
138+
# organism.code = 'mmu',
139+
# org.db = 'org.Mm.eg.db',
140+
# print.support.types = TRUE,
141+
# print.validation.methods = TRUE
142+
# )
143+
144+
## ---- eval=FALSE--------------------------------------------------------------
145+
# custom.integration <- tibble::tibble(
146+
# reference.expression.matrix = 'exp.yang',
147+
# reference.org.db = 'org.Mm.eg.db',
148+
# comparison.table = 'mirtarbase.comparison.table',
149+
# reference.table.name = 'RNA',
150+
# comparison.table.name = 'miRTarBase'
151+
# )
152+
# generateShinyApp(
153+
# expression.matrix = exp.yang,
154+
# metadata = meta,
155+
# modality = "RNA",
156+
# shiny.dir = "shiny_Yang2019_CustomIntegration",
157+
# app.title = "Shiny app for visualisation of three timepoints from the Yang 2019 data",
158+
# organism = "mmusculus",
159+
# org.db = "org.Mm.eg.db",
160+
# custom.integration = custom.integration
161+
# )
162+
# shiny::runApp('shiny_Yang2019_CustomIntegration')
163+
164+
## ----CustomIntegration, echo = FALSE, out.width = "80%"-----------------------
165+
knitr::include_graphics("figures/CustomIntegrationExample.png")
166+
167+
## ----EnrichmentIntegration, echo = FALSE, out.width = "80%"-------------------
168+
knitr::include_graphics("figures/EnrichmentIntegrationExample.png")
169+
170+
## ----sessionInfo--------------------------------------------------------------
171+
sessionInfo()
172+

vignettes/IntegratingMultiomics.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ knitr::opts_chunk$set(
2323
As an example, we consider a subset of the mRNAseq and h3k4me3 ChIPseq data from an experiment included in [a 2019 paper by Yang et al](https://www.sciencedirect.com/science/article/pii/S2405471219301152). The preprocessed mRNAseq data is included in the *bulkAnalyseR* package and can be loaded by running:
2424

2525
```{r bulkAnalyseR, include=FALSE}
26-
devtools::load_all('../')
26+
library("bulkAnalyseR")
2727
```
2828

2929
```{r load Yang 2019 mRNAseq}

0 commit comments

Comments
 (0)