I am attempting to save a BioCircos using the htmlwidget function saveWidget but it is outputting a blank file on my university's cluster whereas it will run (albeit with a smaller subset of my data) on my personal RStudio and will save a half-finished html on my computer but create a perfect interactive graph in my Viewer. I attributed this half-finished saved html to my local computer's lack of computing power, but I'm not so sure if this is the reason and I would like to use a different output (not htmlwidgets) if at all possible.
The input methylation data is a bedgraph file which includes the following columns: Chromosome, ChromStart, ChromEND, Fraction, Count.
The following is my code:
library(BioCircos)
library(htmlwidgets)
# args[1] = biscuit bedgraph, args[2] = bismark, args[3] = bitmapperbs, args[4] = bissnp, args[5] = bwameth
# args[6] = hg38chromsizes.txt,
# args[7] = html file location, args[8] = log file location
args = commandArgs(trailingOnly=TRUE)
hg38 <- read.table(file = args[6], sep = '\t')
hg38$V1 <- as.factor(sub('chr','',hg38$V1))
z <- split(hg38$V2, hg38$V1)
bedgraph <- read.table(file = args[1], sep = '\t', header = FALSE, col.names = c("Chromosome", "ChromStart", "ChromEND", "Fraction", "Count"))
chrom <- c(paste("chr", 1:22, sep = ""), "chrX", "chrY")
x <- subset(bedgraph, subset = Chromosome %in% chrom)
c <- subset(x, Count >= 10)
c$Chromosome <- sub('chr','',c$Chromosome)
biscuit <- BioCircosHeatmapTrack('BioCircoHeatmap', c$Chromosome, c$ChromStart, c$ChromEND+1000000, c$Fraction, minRadius = 0.8, maxRadius = 1, opacities = c(0.4, 0.4, 1, 0.8), color = c("#be55f2", "#40035e"))
bedgraph <- read.table(file = args[2], sep = '\t', header = FALSE, col.names = c("Chromosome", "ChromStart", "ChromEND", "Fraction", "Count"))
chrom <- c(paste("chr", 1:22, sep = ""), "chrX", "chrY")
x <- subset(bedgraph, subset = Chromosome %in% chrom)
c <- subset(x, Count >= 10)
c$Chromosome <- sub('chr','',c$Chromosome)
bismark <- BioCircosHeatmapTrack('BioCircoHeatmap', c$Chromosome, c$ChromStart, c$ChromEND+1000000, c$Fraction, minRadius = 0.60, maxRadius = 0.8, opacities = c(0.4, 0.4, 1, 0.8), color = c("#be55f2", "#40035e"))
bedgraph <- read.table(file = args[3], sep = '\t', header = FALSE, col.names = c("Chromosome", "ChromStart", "ChromEND", "Fraction", "Count"))
chrom <- c(paste("chr", 1:22, sep = ""), "chrX", "chrY")
x <- subset(bedgraph, subset = Chromosome %in% chrom)
c <- subset(x, Count >= 10)
c$Chromosome <- sub('chr','',c$Chromosome)
bitmapperbs <- BioCircosHeatmapTrack('BioCircoHeatmap', c$Chromosome, c$ChromStart, c$ChromEND+1000000, c$Fraction, minRadius = 0.4, maxRadius = 0.6, opacities = c(0.4, 0.4, 1, 0.8), color = c("#be55f2", "#40035e"))
bedgraph <- read.table(file = args[4], sep = '\t', header = FALSE, col.names = c("Chromosome", "ChromStart", "ChromEND", "Fraction", "Count"))
chrom <- c(paste("chr", 1:22, sep = ""), "chrX", "chrY")
x <- subset(bedgraph, subset = Chromosome %in% chrom)
c <- subset(x, Count >= 10)
c$Chromosome <- sub('chr','',c$Chromosome)
bissnp <- BioCircosHeatmapTrack('BioCircoHeatmap', c$Chromosome, c$ChromStart, c$ChromEND+1000000, c$Fraction, minRadius = 0.2, maxRadius = 0.4, opacities = c(0.4, 0.4, 1, 0.8), color = c("#be55f2", "#40035e"))
bedgraph <- read.table(file = args[5], sep = '\t', header = FALSE, col.names = c("Chromosome", "ChromStart", "ChromEND", "Fraction", "Count"))
chrom <- c(paste("chr", 1:22, sep = ""), "chrX", "chrY")
x <- subset(bedgraph, subset = Chromosome %in% chrom)
c <- subset(x, Count >= 10)
c$Chromosome <- sub('chr','',c$Chromosome)
bwameth <- BioCircosHeatmapTrack('BioCircoHeatmap', c$Chromosome, c$ChromStart, c$ChromEND+1000000, c$Fraction, minRadius = 0, maxRadius = 0.2, opacities = c(0.4, 0.4, 1, 0.8), color = c("#be55f2", "#40035e"))
tracks <- biscuit + bismark + bitmapperbs + bissnp + bwameth
p <- BioCircos(tracks, genome = z, genomeFillColor = c("#be55f2", "#40035e"))
saveWidget(p, args[7])
K <- "BioCircos.jpg"
BioCircos(tracks, genome = z, genomeFillColor = c("#be55f2", "#40035e"))