-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqc_boxplot.R
More file actions
35 lines (25 loc) · 743 Bytes
/
Copy pathqc_boxplot.R
File metadata and controls
35 lines (25 loc) · 743 Bytes
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
# standard qc bargraph for ATAC results
library(ggplot2)
library(reshape2)
# Get command line arguments
args <- commandArgs(trailingOnly = TRUE)
# output from pipeline
read_stats <- read.delim(args[1])
# axis label
label <- args[2]
# pdf name
out_name <- args[3]
# Melt table and assign column headers to be 'metrics'
melted_stats <- melt(read_stats, var="metric")
# convert metrics to factors
melted_stats$metric <- factor(melted_stats$metric, levels=unique(melted_stats$metric))
qc_color = "#3A5795"
pdf(out_name)
(ggplot(melted_stats, aes(metric, value))
+ theme_bw()
+ theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank())
+ geom_boxplot(color=qc_color)
+ coord_flip()
+ ylab(label)
)
dev.off()