error when plotting aligned reads depending on the length of the displayed region
1
0
Entering edit mode
@timotheeflutre-6727
Last seen 4.9 years ago
France

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?

gviz plottracks alignmentstrack • 1.2k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Thanks, I will try to do this next week.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
@heshamgibriel-12298
Last seen 7.1 years ago

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.

ADD COMMENT
0
Entering edit mode

You're right, thanks. As I need to zoom in on a short sequence, I will also send an example data set to F. Hahne.

ADD REPLY

Login before adding your answer.

Traffic: 690 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6