# HG changeset patch # User iuc # Date 1602178123 0 # Node ID 7a8a21c5a57f6d8621ad14a1c89be452b1bc4620 "planemo upload commit 3126d8d1bdf88d13a8d168020bdf03dbb2dd1c0b" diff -r 000000000000 -r 7a8a21c5a57f manhattan.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manhattan.R Thu Oct 08 17:28:43 2020 +0000 @@ -0,0 +1,36 @@ +options(show.error.messages = F, error = function() { + cat(geterrmessage(), file = stderr()); q("no", 1, F) + } +) + +# we need that to not crash galaxy with an UTF8 error on German LC settings. +loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") + +suppressPackageStartupMessages({ + library(qqman) + library(optparse) +}) +option_list <- list( + make_option(c("-f", "--file"), type = "character", help = "Input file"), + make_option("--pval", type = "character", + help = "Pvalue column name", default = "P"), + make_option("--chr", type = "character", + help = "Chromosome column name", default = "CHR"), + make_option("--bp", type = "character", + help = "Chromosomal position column name", default = "BP"), + make_option("--snp", type = "character", + help = "Snp name column name", default = "SNP"), + make_option("--name", type = "character", + help = "Plot name", default = "Manhattan Plot")) +args <- parse_args(OptionParser(option_list = option_list)) +file <- args$file +pvalcol <- args$pval +chrcol <- args$chr +bpcol <- args$bp +snpcol <- args$snp +name <- as.character(args$name) +data <- read.table(args$file, header = TRUE) +pdf("manhattan.pdf") +manhattan(data, chr = chrcol, bp = bpcol, + p = pvalcol, snp = snpcol, main = name) +invisible(dev.off()) diff -r 000000000000 -r 7a8a21c5a57f qq_manhattan.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qq_manhattan.xml Thu Oct 08 17:28:43 2020 +0000 @@ -0,0 +1,32 @@ + + + r-qqman + r-optparse + + + + + + + + + + + + + + + + + + + + + + https://doi.org/10.1101/005165 + + diff -r 000000000000 -r 7a8a21c5a57f test-data/manhattan.pdf Binary file test-data/manhattan.pdf has changed diff -r 000000000000 -r 7a8a21c5a57f test-data/test.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/test.tsv Thu Oct 08 17:28:43 2020 +0000 @@ -0,0 +1,20 @@ +CHR SNP BP NMISS BETA SE R2 T P +1 A 10698332 98 16.99 9.273 0.0338 1.832 0.06998 +2 B 10709861 98 24.99 13.88 0.03268 1.801 0.07487 +2 C 10713908 99 16.58 9.446 0.03078 1.755 0.08241 +2 D 10731396 99 8.931 9.762 0.008556 0.9149 0.3625 +5 E 10734030 99 15.97 9.669 0.02736 1.652 0.1018 +20 F 10734392 99 17.52 9.594 0.03325 1.826 0.07087 +20 G 10734837 99 17.91 9.474 0.03552 1.89 0.06172 +20 H 10735563 99 9.958 9.594 0.01099 1.038 0.3018 +20 I 10736191 99 28.51 9.275 0.08875 3.074 0.002747 +20 J 10736745 99 22.71 9.481 0.05583 2.395 0.01855 +21 K 10747597 99 24.44 13.9 0.03091 1.759 0.08175 +21 L 10752085 99 10.22 9.448 0.01191 1.081 0.2823 +21 M 10757751 99 26.4 13.02 0.04065 2.027 0.04538 +21 N 10767089 99 26.4 13.02 0.04065 2.027 0.04538 +21 O 10769074 99 7.57 9.649 0.006306 0.7846 0.4346 +22 P 10769413 99 7.526 9.774 0.006075 0.77 0.4432 +22 Q 10775447 99 17.34 9.412 0.0338 1.842 0.06853 +22 R 10775576 99 10.69 9.618 0.01258 1.112 0.269 +22 S 10776410 99 3.982 9.551 0.001789 0.4169 0.6777