It's been a few years and looks like there still isn't any option to disable smoothing for
AlignmentsTrack. At least I don't see any way to do it from the Gviz documentation and the the R source code in
R/Gviz-methods.R in the
drawGD method for
AlignmentsTrack still forces the smoothing logic pointed out by Florian's comment when the read size is more than 2 pixels.
As workaround, I use
DataTrack as explained in the section "Building DataTrack objects from files" section of the Gviz vignette copied here for convenience:
bamFile <- system.file("extdata/test.bam", package = "Gviz")
dTrack4 <- DataTrack(range = bamFile, genome = "hg19", type = "l",
name = "Coverage", window = -1,
chromosome = "chr1")
plotTracks(dTrack4, from = 189990000, to = 190000000)
... you don't get the benefit of the rug plot, fill color, etc. as you would with
AlignmentsTrack, nevertheless using
DataTrack seems practical for simple use cases of plotting coverage.
I have sparse reads, and use the
type = "h" to get a histogram similar to the UCSC browser.