-
Notifications
You must be signed in to change notification settings - Fork 8
/
EDF6.R
36 lines (25 loc) · 1.15 KB
/
EDF6.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
# =======================================================================================================
# This is a script for generating EDF6: Correction for batch effects - Splicing data
#
# Note that the final figure was generated by using inkscape by combining figures from this script for visualization purposes
#
# =======================================================================================================
#!/bin/R
# Read in input data
edf6c=read.table("EDF6c_data.txt", sep="\t", header=T)
#Libraries
library(ggplot2)
library(cowplot)
library(ggpubr)
## Panel A
# PCA plot of first 2 PCs uncorrected data. PC1 and PC2 data available
## Panel B
# PCA plot of first 2 PCs corrected data. PC1 and PC2 data available
# Panel C
edf6c_plot=ggplot(data = edf6c, aes(x=Var2, y=as.factor(Var1), fill=value)) +
geom_tile(color = "white")+
scale_fill_gradient2(low = "blue", high = "red", mid = "white",
midpoint = 0, limit = c(-1,1), space = "Lab",
name="Pearson\nCorrelation") +
theme_minimal()+
coord_fixed() + labs(x='PCs', y='Covariates')+theme(legend.position="right")+ theme(axis.text.x = element_text(angle = 45, hjust = .8))