Commit 449e555b authored by van den Berg's avatar van den Berg
Browse files

Use the tools library to determine file extension

The previous code determined the extension by splitting the file path on a dot
(.), which failed when the file path contains dots in folder names.

This commit fixes issue #14
parent 4a0dc089
Pipeline #3886 passed with stages
in 52 minutes and 28 seconds
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# Copyright (c) 2015 Leiden University Medical Center <http://lumc.nl> # Copyright (c) 2015 Leiden University Medical Center <http://lumc.nl>
# All rights reserved. # All rights reserved.
library("tools")
suppressMessages(library(Gviz)) suppressMessages(library(Gviz))
RenameEnsemblChroms <- function(annots) { RenameEnsemblChroms <- function(annots) {
...@@ -359,7 +360,7 @@ MakePlot <- function(parsed.data, sample.name, gene.id, gene.model, genome = "hg ...@@ -359,7 +360,7 @@ MakePlot <- function(parsed.data, sample.name, gene.id, gene.model, genome = "hg
plot.title <- paste(c("Variant Calls - Sample '", sample.name, "'\n", gene.symbol, plot.title <- paste(c("Variant Calls - Sample '", sample.name, "'\n", gene.symbol,
" (", gene.id, ")"), collapse = "") " (", gene.id, ")"), collapse = "")
if (!is.null(out.file) & tolower(unlist(strsplit(out.file, "\\."))[-1]) == "png") { if (!is.null(out.file) & file_ext(out.file) == "png") {
png(out.file, height = to.plot$height, width = to.plot$width) png(out.file, height = to.plot$height, width = to.plot$width)
Gviz::plotTracks(to.plot$tracks, chromosome = chrom, main = plot.title, Gviz::plotTracks(to.plot$tracks, chromosome = chrom, main = plot.title,
col = NULL, sizes=to.plot$sizes) col = NULL, sizes=to.plot$sizes)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment