Skip to content
Snippets Groups Projects
Commit e63bce75 authored by james94's avatar james94
Browse files

fix X11 display error

parent 4e0dc623
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ dependencies: ...@@ -5,6 +5,7 @@ dependencies:
- igvtools - igvtools
- openjdk=11.0.8 - openjdk=11.0.8
- r-base=3.6.3 - r-base=3.6.3
- cairo=1.16.0
- r-ggplot2 - r-ggplot2
- r-argparse - r-argparse
- r-scales - r-scales
......
...@@ -133,14 +133,14 @@ plot_stack <- function(dat, name, x_max, y_max, zero, cutoff) { ...@@ -133,14 +133,14 @@ plot_stack <- function(dat, name, x_max, y_max, zero, cutoff) {
} }
save_plot <- function(name, type, outformat, h, w) { save_plot <- function(name, type, outformat, h, w) {
ggsave(file = paste(name, type, outformat, sep = "."), height = h, width = w) ggsave(file = paste(name, type, outformat, sep = "."), type = c("cairo", "cairo-png", "Xlib", "quartz"), height = h, width = w)
} }
spectra_cn_plot <- function(hist, name, zero="", cutoff="", w=6, h=4.5, x_max, y_max, type="all", pdf=FALSE) { spectra_cn_plot <- function(hist, name, zero="", cutoff="", w=6, h=4.5, x_max, y_max, type="all", pdf=FALSE) {
# Read hist # Read hist
dat=read.table(hist, header=TRUE) dat=read.table(hist, header=TRUE)
dat[,1]=factor(dat[,1], levels=unique(dat[,1]), ordered=TRUE) # Lock in the order dat[,1]=factor(dat[,1], levels=unique(dat[,1]), ordered=TRUE) # Lock in the order
# Read asm-only # Read asm-only
dat_0 = NULL dat_0 = NULL
if (zero != "") { if (zero != "") {
...@@ -180,19 +180,19 @@ spectra_cn_plot <- function(hist, name, zero="", cutoff="", w=6, h=4.5, x_max, ...@@ -180,19 +180,19 @@ spectra_cn_plot <- function(hist, name, zero="", cutoff="", w=6, h=4.5, x_max,
if (pdf) { if (pdf) {
outformat="pdf" outformat="pdf"
} }
if (type == "all" || type == "line") { if (type == "all" || type == "line") {
print("## Line graph") print("## Line graph")
plot_line(dat, name, x_max, y_max, zero = dat_0, cutoff = dat_cut) plot_line(dat, name, x_max, y_max, zero = dat_0, cutoff = dat_cut)
save_plot(name=name, type="ln", outformat, h=h, w=w) save_plot(name=name, type="ln", outformat, h=h, w=w)
} }
if (type == "all" || type == "fill") { if (type == "all" || type == "fill") {
print("## Area under the curve filled") print("## Area under the curve filled")
plot_fill(dat, name, x_max, y_max, zero = dat_0, cutoff = dat_cut) plot_fill(dat, name, x_max, y_max, zero = dat_0, cutoff = dat_cut)
save_plot(name=name, type="fl", outformat, h=h, w=w) save_plot(name=name, type="fl", outformat, h=h, w=w)
} }
if (type == "all" || type == "stack") { if (type == "all" || type == "stack") {
print("## Stacked") print("## Stacked")
plot_stack(dat, name, x_max, y_max, zero = dat_0, cutoff = dat_cut) plot_stack(dat, name, x_max, y_max, zero = dat_0, cutoff = dat_cut)
...@@ -201,5 +201,3 @@ spectra_cn_plot <- function(hist, name, zero="", cutoff="", w=6, h=4.5, x_max, ...@@ -201,5 +201,3 @@ spectra_cn_plot <- function(hist, name, zero="", cutoff="", w=6, h=4.5, x_max,
} }
spectra_cn_plot(hist = args$file, name = args$output, zero = args$zero, cutoff = args$cutoff, h = args$ydim, w = args$xdim, x_max = args$xmax, y_max = args$ymax, type = args$type, pdf = args$pdf) spectra_cn_plot(hist = args$file, name = args$output, zero = args$zero, cutoff = args$cutoff, h = args$ydim, w = args$xdim, x_max = args$xmax, y_max = args$ymax, type = args$type, pdf = args$pdf)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment