forked from kkovary/ATAC-seq-Shiny-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.Rmd
80 lines (60 loc) · 1.68 KB
/
report.Rmd
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
---
title: "ATAC-seq Report"
output: pdf_document
params:
gene: NA
ymax: NA
xrange: NA
gvizPlot: NA
tf_legend: NA
rnaPlot: NA
chr: NA
transcriptID: NA
---
```{r include=FALSE}
library(Gviz)
library(ggplot2)
library(ggpubr)
library(feather)
library(GenomicRanges)
# source('/Gviz_Plots.R')
#
# ENSEMBL_hg38_local_fromGTF <- read_feather('/ENSEMBL_hg38_local_fromGTF.feather') %>%
# makeGRangesFromDataFrame(keep.extra.columns = T)
#
# transcript_locations <- read_feather('/transcript_locations.feather')
```
## Summary for `r params$gene`.
Include information such as correlation cuttoff, selected transcript, etc.
\newpage
```{r echo=FALSE, fig.height=14, fig.width=12}
x <- params$gvizPlot
transcript_start <- if(params$transcriptID == 'Any'){
getGtfCoords(params$gene,ENSEMBL_hg38_local_fromGTF)[[2]]
} else{
filter(transcript_locations, refseq_mrna == params$transcriptID)$transcript_start
}
transcript_end <- if(params$transcriptID == 'Any'){
getGtfCoords(params$gene,ENSEMBL_hg38_local_fromGTF)[[3]]
} else{
filter(transcript_locations, refseq_mrna == params$transcriptID)$transcript_end
}
# for(i in 2:14){
# x[[i]]@dp@pars$fontsize = 10
# x[[i]]@name = LETTERS[i-1]
# }
plotTracks(HighlightTrack(x[1:(length(x)-1)],
start = transcript_start,
end = transcript_end,
chr = params$chr), col.title = 'black',
from = params$xrange[1], to = params$xrange[2])
```
```{r echo=FALSE, fig.height=1, fig.width=12}
if(!is.null(params$tf_legend)){
params$tf_legend
}
```
```{r echo=FALSE, message=FALSE, warning=FALSE, fig.height=12, fig.width=12}
x <- params$rnaPlot
eval(x)
```