-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGWH.R
50 lines (40 loc) · 1.15 KB
/
GWH.R
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
setwd("enter/appropriate/path")
#in R for every ml file
a<-scan("Filename.ml")
a[2]/sum(a)
#record output in excel file
#load excel file to make graphs
library(ggplot2)
library(tidyr)
library(dplyr)
library(ggrepel)
x2<-data
x2 %>%
ggplot(aes(x = depth, y = GWH)) +
geom_point(color = "blue") +
geom_text_repel(aes(label = Heterozygosity)) +
ggtitle("Heterozygosity as a function of sequencing coverage") +
xlab("Coverage Depth (X)") +
ylab("Genome Wide Heterozygosity (GWH)") +
theme_classic()
x2 %>%
ggplot(aes(x = breadth, y = GWH)) +
geom_point(color = "green") +
geom_text_repel(aes(label = Heterozygosity)) +
ggtitle("Heterozygosity as a function of sequencing coverage") +
xlab("Coverage Breadth (%)") +
ylab("Genome Wide Heterozygosity (GWH)") +
theme_classic()
x2 %>%
ggplot(aes(x = breadth, y = depth)) +
geom_point(color = "black") +
geom_text_repel(aes(label = Heterozygosity)) +
ggtitle("Sequencing Coverage") +
xlab("Coverage Breadth (%)") +
ylab("Coverage Depth (X)") +
theme_classic()
data<-read.csv("heteroz.csv")
head(data)
str(data) #make sure data is being read correctly
attach(data)
plot(depth, GWH)