Hi Lance,
The default is to auto-compute a reasonable window size, I think it is loosely based on the data density (quantiles, if I remember correctly).
Even though we “only” compute coverage vectors this still requires reading in a lot of reads because the CIGAR strings need to be evaluated (gapped alignments, soft and hard clipping, etc.) Of course one does not need to load all reads for the whole range at once, and I will need to check whether this is actually happening. Surely some room for improvements there.
Florian

From: Lance Parsons <lparsons@princeton.edu<mailto:lparsons@princeton.edu>>
Date: Monday 19 May 2014 16:49
To: Florian Hahne <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>>
Cc: "bioconductor@r-project.org<mailto:bioconductor@r-project.org>" <bioconductor@r-project.org<mailto:bioconductor@r-project.org>>, "tim.triche@gmail.com<mailto:tim.triche@gmail.com>" <tim.triche@gmail.com<mailto:tim.triche@gmail.com>>
Subject: Re: Displaying very deep coverage in Gviz

Thanks Florian and Tim. I was able to get a very nice plot using type='polygon', and window=-1. I'm actually not quite sure what this does, since I did not set the windowSize parameter (and the default is supposedly NULL).

I'm not sure what is going on with the AlignmentsTrack since this is a coverage only plot there shouldn't be any need to large memory usage.

Lance

Hahne, Florian wrote:

Hi Lance,
If you want to go down the DataTrack road you may want to take a look at
the window parameter to introduce a bit of smoothing. However I suspect
that your problem is already in the calculation of the coverage vector for
your bigwig files, because the AlignmentsTrack does not do much to that
vector but rather tries to plot it as is, in a similar fashion as the
DataTrack(type="histogram²) method would do.
There seems to be a more general issue here with these kinds of ultra-deep
coverage tracks, and I am wondering whether a reasonable resampling
strategy wouldn¹t be a better way to go forward. I will have to check the
Rsamtools functions that I am using for computing the coverage vectors
from BAM file, but I am pretty sure that resampling is already in place.
Will let you know.
Florian

On 15/05/14 18:36, "Lance Parsons" <lparsons@princeton.edu><mailto:lparsons@princeton.edu> wrote:



I have been using Gviz to display coverage plots quite nicely using the
new AlignmentsTrack, however, I've now run into a bit of an issue.
There are some regions where we have very deep coverage (>20000 reads).
This is causing Gviz to use excessive amounts of memory and thus makes
plotting these regions unfeasible.

Since I only need to plot coverage, I thought a solution might be to use
bedgraph or bigwig files and the DataTrack class to plot these.
However, it appears that the AlignmentsTrack object does some nice
smoothing of the data when plotting.  When I plot the coverage using a
"polygon" type in the DataTrack class, the plot does not look comparable
to my other plots and indeed doesn't look very nice.

Any suggestions on how to either get the AlignmentsTrack class to handle
very deep data for coverage plots only or to replicate the smoothing in
the DataTracks class? Thanks.

--
Lance Parsons - Scientific Programmer
134 Carl C. Icahn Laboratory
Lewis-Sigler Institute for Integrative Genomics
Princeton University



--
Lance Parsons - Scientific Programmer
134 Carl C. Icahn Laboratory
Lewis-Sigler Institute for Integrative Genomics
Princeton University


	[[alternative HTML version deleted]]

