forked from gchoonoo/HNSCC_Notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mutation_and_cnv_breakdown.Rmd
58 lines (41 loc) · 2.4 KB
/
mutation_and_cnv_breakdown.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
---
title: "Breakdown of Mutation and CNV Files"
author: "Ted Laderas"
date: "9/15/2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
library(here)
library(data.table)
library(dplyr)
mutation_file <- fread(here("data/TCGA.HNSC.mutect.84c7a87a-9dcc-48fb-bd69-ba9d6e6f3ca2.DR-7.0.somatic_cleaned.maf"))
hpv_pos_file <- fread(here("data/TCGA.HNSC.HPV-negative.maf"))
hpv_neg_file <- fread(here("data/TCGA.HNSC.HPV-negative.maf"))
cnv_file <- fread(here("data/gistic_long_file.maf"))
```
# Breakdown of Main Mutation File
```{r}
top20 <- mutation_file %>% group_by(Hugo_Symbol) %>% summarize(count = n()) %>% top_n(20) %>% arrange(desc(count)) %>% pull(Hugo_Symbol)
mutation_file %>% filter(Hugo_Symbol %in% top20) %>%
mutate(gene = ordered(Hugo_Symbol, levels = top20)) %>% ggplot(aes(x=gene, fill= Variant_Classification)) + geom_bar() + theme_minimal() + theme(axis.text.x = element_text(angle = 90)) + ggtitle("Breakdown of Mutation by Variant Type")
```
# Breakdown of CNV File
```{r}
top20 <- cnv_file %>% group_by(Hugo_Symbol) %>% summarize(count = n()) %>% top_n(20) %>% arrange(desc(count)) %>% pull(Hugo_Symbol)
cnv_file %>% filter(Hugo_Symbol %in% top20) %>%
mutate(gene = ordered(Hugo_Symbol, levels = top20)) %>% ggplot(aes(x=gene, fill= Variant_Type)) + geom_bar() + theme_minimal() + theme(axis.text.x = element_text(angle = 90)) + ggtitle("Breakdown of CNV by Variant Type")
```
# Breakdown of HPV Positive by Variant Type
```{r}
top20 <- hpv_pos_file %>% group_by(Hugo_Symbol) %>% summarize(count = n()) %>% top_n(20) %>% arrange(desc(count)) %>% pull(Hugo_Symbol)
hpv_pos_file %>% filter(Hugo_Symbol %in% top20) %>%
mutate(gene = ordered(Hugo_Symbol, levels = top20)) %>% ggplot(aes(x=gene, fill= Variant_Classification)) + geom_bar() + theme_minimal() + theme(axis.text.x = element_text(angle = 90)) + ggtitle("Breakdown of Mutations in HPV+ \nby Variant Type")
```
# Breakdown of HPV Positive by Variant Type
```{r}
top20 <- hpv_pos_file %>% group_by(Hugo_Symbol) %>% summarize(count = n()) %>% top_n(20) %>% arrange(desc(count)) %>% pull(Hugo_Symbol)
hpv_pos_file %>% filter(Hugo_Symbol %in% top20) %>%
mutate(gene = ordered(Hugo_Symbol, levels = top20)) %>% ggplot(aes(x=gene, fill= Variant_Classification)) + geom_bar() + theme_minimal() + theme(axis.text.x = element_text(angle = 90)) + ggtitle("Breakdown of Mutations in HPV- \nby Variant Type")
```