-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLynchvsCephMutationRates.Rmd
More file actions
61 lines (43 loc) · 2.58 KB
/
LynchvsCephMutationRates.Rmd
File metadata and controls
61 lines (43 loc) · 2.58 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
---
title: "LynchvsCephMutationRates"
author: "Laurel Hiatt"
date: "3/24/2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Brief Overview of Data
Both data sets are comprised of autosomal SNVs/autosomal callable fractions,
matched to sample and then with added sample source.
```{r data}
setwd('/Users/quinlan/Documents/Quinlan-PhD/lynchsynpedsnotebook')
list.files()
Lynchdata = read.table("LynchMutsOverCallable.csv", header = TRUE, sep = ',')
Cephdata = read.table("CephMutsOverCallable.csv", header = TRUE, sep = ',')
library(ggplot2)
library(cowplot)
```
## Comparison Plot
```{r Boxplot, echo=FALSE}
lynch <- data.frame(group = "lynch", value = Lynchdata)
ceph <- data.frame(group = "ceph", value = Cephdata)
plotdata <- rbind(lynch,ceph)
ggplot(plotdata) + geom_boxplot(aes(x = group, y = (value.mut_over_callable/2))) + xlab('') + ylab('Mutation Rates') + theme_cowplot() + geom_jitter(aes(x = group, y = (value.mut_over_callable/2), color = value.source))
```
# Multiplying by Genome for Counts Approximation
```{r Normalizingdata, echo=FALSE}
Lynchdata$approximatecounts = (Lynchdata$mut_over_callable*5750003044)
Cephdata$approximatecounts = (Cephdata$mut_over_callable*5750003044)
# calculated from autosomal chromosome bed file, summed and * 2 for diploid
lynch <- data.frame(group = "lynch", value = Lynchdata)
ceph <- data.frame(group = "ceph", value = Cephdata)
plotdata <- rbind(lynch,ceph)
ggplot(plotdata) + geom_boxplot(aes(x = group, y = (value.approximatecounts/2))) + xlab('') + ylab('Approximate Mutations') + theme_cowplot() + geom_jitter(aes(x = group, y = (value.approximatecounts/2), color = value.source)) + geom_hline(yintercept=70.1, color = 'red', linetype = 'dashed')
#70.1 from sasani paper, average number of mutations for haploid genome
ggplot(plotdata) + geom_boxplot(aes(x = group, y = (value.approximatecounts/2))) + xlab('') + ylab('Mutation Rates') + theme_cowplot() + theme(legend.position="none") + geom_jitter(aes(x = group, y = (value.approximatecounts/2)))
ggplot(plotdata) + geom_boxplot(aes(x = group, y = (value.approximatecounts/2))) + xlab('') + ylab('Approximate Mutations') + theme_cowplot() + geom_jitter(aes(x = group, y = (value.approximatecounts/2), color = value.source)) + geom_hline(yintercept = 70, linetype= 'dotted', color = 'red')
```
```{r statistics}
t.test(Lynchdata$mut_over_callable, Cephdata$mut_over_callable)
```