-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis_bstat.R
17 lines (12 loc) · 940 Bytes
/
analysis_bstat.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require("ggplot2");
options <- commandArgs(trailingOnly = TRUE)
thirty <- read.table(options[1], header=F, col.names=c(rep('',2),'allelefreq','snps','ti','tv','indel',rep('',3)), colClasses=c(rep('NULL',2),rep('numeric',5),rep('NULL',3)));
thirty$coverage <- '30x';
fifteen <- read.table(options[2], header=F, col.names=c(rep('',2),'allelefreq','snps','ti','tv','indel',rep('',3)), colClasses=c(rep('NULL',2),rep('numeric',5),rep('NULL',3)));
fifteen$coverage <- '15x';
covdata <-rbind(fifteen, thirty);
palette <- c("#0072B2", "#D55E00");
hist_plot <- ggplot(data=covdata, aes(x=allelefreq, y=snps, colour=coverage)) + geom_line() + scale_fill_manual(values=palette) + scale_y_log10();
ggsave(filename=options[3],plot=hist_plot);
hist_indel_plot <- ggplot(data=covdata, aes(x=allelefreq, y=indel, colour=coverage)) + geom_line() + scale_fill_manual(values=palette) + scale_y_log10();
ggsave(filename=options[4],plot=hist_indel_plot);