comparison manhattan.R @ 0:7a8a21c5a57f draft default tip

"planemo upload commit 3126d8d1bdf88d13a8d168020bdf03dbb2dd1c0b"
author iuc
date Thu, 08 Oct 2020 17:28:43 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:7a8a21c5a57f
1 options(show.error.messages = F, error = function() {
2 cat(geterrmessage(), file = stderr()); q("no", 1, F)
3 }
4 )
5
6 # we need that to not crash galaxy with an UTF8 error on German LC settings.
7 loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
8
9 suppressPackageStartupMessages({
10 library(qqman)
11 library(optparse)
12 })
13 option_list <- list(
14 make_option(c("-f", "--file"), type = "character", help = "Input file"),
15 make_option("--pval", type = "character",
16 help = "Pvalue column name", default = "P"),
17 make_option("--chr", type = "character",
18 help = "Chromosome column name", default = "CHR"),
19 make_option("--bp", type = "character",
20 help = "Chromosomal position column name", default = "BP"),
21 make_option("--snp", type = "character",
22 help = "Snp name column name", default = "SNP"),
23 make_option("--name", type = "character",
24 help = "Plot name", default = "Manhattan Plot"))
25 args <- parse_args(OptionParser(option_list = option_list))
26 file <- args$file
27 pvalcol <- args$pval
28 chrcol <- args$chr
29 bpcol <- args$bp
30 snpcol <- args$snp
31 name <- as.character(args$name)
32 data <- read.table(args$file, header = TRUE)
33 pdf("manhattan.pdf")
34 manhattan(data, chr = chrcol, bp = bpcol,
35 p = pvalcol, snp = snpcol, main = name)
36 invisible(dev.off())