-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbtb-summary_short.Rmd
135 lines (107 loc) · 3.8 KB
/
btb-summary_short.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
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
---
output:
html_document:
toc: false
toc_float: false
toc_depth: 4
number_sections: false
code_folding: hide
df_print: paged
editor_options:
chunk_output_type: console
---
<!-- CSS style for tables to look ok: -->
<style>
body {
position: absolute;
left: 0px;}
width: 100%;
table, td, th {
border: none;
padding-left: 1em;
padding-right: 1em;
min-width: 50%;
<!-- max-width: 1600px; -->
margin-left: 1em;
margin-right: 1em;
margin-top: 1em;
margin-bottom: 1em;
}
</style>
<!-- Markdown setup -->
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,comment = '',warning=F,error = F)
options(width = 600)
```
# {.tabset .tabset-fade .tabset-pills}
<!-- This script reads from a folder containing the CAW output, plus copy number data generated by controlfreec.-->
```{r,include=FALSE}
library(data.table)
library(knitr)
library(kableExtra)
library(ggplot2)
library(ggrepel)
library(VariantAnnotation)
library(gridExtra)
library(htmlTable)
chrsz=structure(list(chr = c("1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
"20", "21", "22", "X", "Y"), starts = c(0, 253902921, 500669562,
703689723, 898025604, 1084280925, 1259870526, 1424144247, 1574191848,
1717288929, 1855896810, 1995944331, 2134165212, 2253485013, 2363996694,
2470839615, 2565902256, 2654091777, 2739309138, 2802869979, 2871941700,
2923598421, 2979326382, 3140008743), length = c(248902921, 241766641,
198020161, 189335881, 181255321, 170589601, 159273721, 145047601,
138097081, 133607881, 135047521, 133220881, 114319801, 105511681,
101842921, 90062641, 83189521, 80217361, 58560841, 64071721,
46656721, 50727961, 155682361, 56827081)), .Names = c("chr",
"starts", "length"), row.names = c(NA, -24L), class = "data.frame")
#sampleDir='~/BTBdata/' # current dev sample
#sampleDir='.' # we assume we are in a sample dir
```
## Then {.tabset}
<!-- First, make a list of files to read and visualize -->
```{r,include=FALSE}
sampleData <- data.table(
name=basename(getwd()),
directory=getwd(),
date=date()
)
knitr::kable(chrsz, format = "latex", caption = "Sample data, name and folder")
files=dir(recursive = T,full.names = T)
files=files[-grep(pattern = '.png',x = files)]
# control freec files
freec_Tratio_file=files[grep(pattern = 'T.hg38.pileup.gz_ratio.txt',files)]
freec_Nratio_file=files[grep(pattern = 'T.hg38.pileup.gz_normal_ratio.txt',files)]
freec_Tbaf_file=files[grep(pattern = 'T.hg38.pileup.gz_BAF.txt',files)]
freec_Nbaf_file=files[grep(pattern = 'B.hg38.pileup.gz_BAF.txt',files)]
freec_info_file=files[grep(pattern = 'hg38.pileup.gz_info.txt',files)]
# VEP structural variant files
vep_Tstruct_file=grep(pattern = glob2rx("*VEP/Manta*somaticSV.ann.vcf"),files,value = T)
vep_Nstruct_file=grep(pattern = glob2rx("*VEP/Manta*diploidSV.ann.vcf"),files,value = T)
# VEP small variant files
vep_Tsmall_file=grep(pattern = glob2rx("*VEP/haplotypecaller*T.vcf.ann.vcf"),files,value = T)
vep_Nsmall_file=grep(pattern = glob2rx("*VEP/haplotypecaller*N.vcf.ann.vcf"),files,value = T)
# snpEff Murect2 file
snpEff_mutect2_file=grep(pattern = glob2rx("*SnpEff/mutect2_*vcf.ann.vcf"),files,value = T)
```
### Mid1
```{r}
sampleData$link="<a href='https://cancer.sanger.ac.uk/cosmic/mutation/overview?id=0029964'>rs990029964</a>"
htmlTable(sampleData, col.rgroup = c("none", "#F7F7F7"))
kable(sampleData, "html") %>%
kable_styling(bootstrap_options = "striped", full_width = F, position = "left")
kable(chrsz, "html") %>%
kable_styling(bootstrap_options = "striped",position = "left") %>%
scroll_box(width = "1000px", height = "600px")
```
### Mid2 {.active .tabset}
Tralala
```{r plot_manta, echo=FALSE,fig.width=15,fig.height=8}
for ( i in 1:3) print(qplot(rnorm(1000),rnorm(1000)))
```
#### tjosan
mämä
#### hoppsan
mömö
## Last