Hi,
I'm running into an error that I haven't been able to get around. Here's the code needed to reproduce it (the data is available here):
source("https://bioconductor.org/biocLite.R")
biocLite("chimeraviz")
library(chimeraviz)
fc <- importFusioncatcher(filename = 'SRR1559032_out/final-list_candidate-fusion-genes.GRCh37.txt', "hg19", 100)
# Load the results file into a list of fusion objects
fusion <- getFusionById(fc, id = '44')
fusion
# read fastq files with reads for that fusion
fastq1 <- 'SRR1559032_fusion_R1.fq'
fastq2 <- 'SRR1559032_fusion_R2.fq'
# extract the fusion junction sequence
referenceFilename <- "reference.fa"
writeFusionReference(fusion = fusion, filename = referenceFilename)
# map fusion reads to the fusion junction sequence
# align the reads you have against the fusion junction sequence
source(system.file(
"scripts",
"rsubread.R",
package="chimeraviz"))
# create an index for our reference sequence, the fusion junction seq
rsubreadIndex(referenceFasta = referenceFilename)
# align the reads against the reference
# this will create fusionAlignment.bam file
rsubreadAlign(
referenceName = referenceFilename,
fastq1 = fastq1,
fastq2 = fastq2,
outputBamFilename = "fusionAlignment")
bamfile <- 'fusionAlignment.bam'
# Create Biostrings::DNAStringSet of fusion sequence
fusionSequence <- Biostrings::DNAStringSet(
x = c(fusion@geneA@junctionSequence,
fusion@geneB@junctionSequence))
names(fusionSequence) <- "chrNA"
fusionReadsAlignment <- Gviz::AlignmentsTrack(
bamfile,
isPaired = TRUE,
# Setting chromosome to chrNA because this is a fusion sequence not found in
# any reference genome.
chromosome = "chrNA",
name="Fusion Reads",
genome = fusion@genomeVersion)
# This call leads to the error:
Gviz::plotTracks(
fusionReadsAlignment,
chromosome = "chrNA",
from = 1,
to = nchar(fusionSequence))
# Error in data.frame(x1 = start(pairGaps) - 1, y1 = gy, x2 = end(pairGaps) + :arguments imply differing number of rows: 0, 1
# Note that if I set isPaired to FALSE instead, then the plot works (but this is not what we want to do)
fusionReadsAlignment2 <- Gviz::AlignmentsTrack(
bamfile,
isPaired = FALSE,
# Setting chromosome to chrNA because this is a fusion sequence not found in
# any reference genome.
chromosome = "chrNA",
name="Fusion Reads",
genome = fusion@genomeVersion)
Gviz::plotTracks(
fusionReadsAlignment2,
chromosome = "chrNA",
from = 1,
to = nchar(fusionSequence))
Is there something wrong with the input data there, or is there something going wrong in gviz?

Thank you! :)