-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae78208
commit bfa0bc7
Showing
1 changed file
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
#! /usr/bin/env Rscript | ||
|
||
#--------------------------------------------------------- | ||
# Copyright 2015 Ontario Institute for Cancer Research | ||
# Written by Jared Simpson ([email protected]) | ||
#--------------------------------------------------------- | ||
# obtained from:https://nanopolish.readthedocs.io/en/latest/quickstart_call_methylation.html | ||
# Usage: Rscript --vanilla plot_methylation.R -i bi_vs_f5c.tsv -o bi_vs_f5c.pdf | ||
|
||
#install.packages("optparse") | ||
#install.packages("ggplot2") | ||
|
||
library(ggplot2) | ||
library(RColorBrewer) | ||
output <- "bul_vs_f5c.pdf" | ||
input <- "bul_vs_f5c.tsv" | ||
library(optparse) | ||
|
||
option_list = list( | ||
make_option(c("-i", "--input"), type="character", default=NULL, | ||
help="input methylation comparison tsv file name", metavar="character"), | ||
make_option(c("-o", "--out"), type="character", default="out.pdf", | ||
help="output file name [default= %default]", metavar="character") | ||
); | ||
|
||
opt_parser = OptionParser(option_list=option_list); | ||
opt = parse_args(opt_parser); | ||
|
||
if (is.null(opt$input)){ | ||
print_help(opt_parser) | ||
stop("At least -i input.tsv must be provided.n", call.=FALSE) | ||
} | ||
|
||
output <- opt$out | ||
input <- opt$input | ||
pdf(file = output, width=10, height=8) | ||
data <- read.table(input, header=T) | ||
|
||
|
@@ -25,4 +48,4 @@ ggplot(data, aes(frequency_1, frequency_2)) + | |
ggtitle(title) | ||
|
||
dev.off() | ||
|