Question: error when plotting aligned reads depending on the length of the displayed region
0
2.2 years ago by
France
TimothéeFlutre70 wrote:

I would like to plot aligned reads from a bam file over a specific region. Everything works fine with the following command:

alTrack <- AlignmentsTrack(my.bam.file, isPaired=TRUE)
snp.pos <- 308632
plotTracks(alTrack, chromosome="chr1", from=snp.pos-200, to=snp.pos+100)

But shortening the region (by increasing from) results in an error:

plotTracks(alTrack, chromosome="chr1", from=snp.pos-100, to=snp.pos+100)
Error in data.frame(x1 = start(pairGaps) - 1, y1 = gy, x2 = end(pairGaps) +  :
arguments imply differing number of rows: 0, 1

How can I fix this?

modified 2.2 years ago by hesham.gibriel0 • written 2.2 years ago by TimothéeFlutre70

Looks a lot like a bug, but hard to say where it is happening without further details. If you could wrap this into a smaller reproducible example together with the necessary data to test I will take a closer look.

Thanks,

Florian

Thanks, I will try to do this next week.

I just sent you an email with a minimal reproducible example in attachment, thanks!

Answer: error when plotting aligned reads depending on the length of the displayed regio
0
2.2 years ago by
hesham.gibriel0 wrote:

I had the same problem too. Your reads are paired end, that's why when you plot a region that might only show one mate but not the other you get this kind of error. If you try to specify the location of the other mate, e.g. add 1500 bp upstream and downstream, you will not get this error.