-
Notifications
You must be signed in to change notification settings - Fork 8
/
EDF7.R
60 lines (45 loc) · 1.86 KB
/
EDF7.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
51
52
53
54
55
56
57
58
59
# =======================================================================================================
# This is a script for generating EDF7: Allele specific expression across rare disease samples
#
# Note that the final figure was generated by using inkscape by combining figures from this script for visualization purposes
#
# =======================================================================================================
#!/bin/R
library(data.table)
library(dplyr)
library(ggplot2)
library(gridExtra)
library(reshape2)
library(cowplot)
library(ggrepel)
library(readr)
library(ggpubr)
fsize=15
RD_theme=theme_classic()+
theme(axis.text.x= element_text(size=fsize),
axis.text.y= element_text(size=fsize),
axis.title = element_text(size = fsize),
legend.text = element_text(size = fsize-1),
legend.title = element_text(size = fsize),
axis.ticks = element_line(size = 0.1),
strip.background=element_blank(),
panel.grid.major=element_blank(),
panel.grid.minor=element_blank(),
axis.text=element_text(size=9),
# Read in data
edf7a=read.table("EDF7a_data.txt", sep="\t", header=T)
edf7b=read.table("EDF7B_data.txt", sep="\t", header=T)
# EDF7A
color_variant=c( "#2F4E6F", "#98B1C4", "#C8D7E3")
edf7a_plot = ggplot(edf7a, aes(x=factor(variable), y=as.numeric(value), Group=variant_data)) +
geom_boxplot(aes(fill=variant_data)) + xlab('') +
ylab('Number per sample') +
RD_theme+ scale_fill_manual(values=color_variant,name="Variant data")+
scale_y_log10()+
theme(legend.position=c(0.8,0.9))+
scale_x_discrete(labels=c("allhets" = "Heterozygous\nsites", "AI.65"="Allelic ratio\nover 0.65" ))
# EDF7B
cat.colors = c('grey', '#DEADA1')
edf7b_plot=ggplot(edf7b, aes(x=Filter,y=NumMatch, fill=Category)) + geom_boxplot(outlier.colour = NULL) +
stat_compare_means(aes(group=Category),label = "p.signif") +
scale_fill_manual(values=cat.colors)