Description Usage Arguments Value See Also Examples
Uses RSamtools to import coverage data from .bam file and format it appropriately for plotting with gmoviz.
1 2 | getCoverage(regions_of_interest, bam_file, window_size = 1,
smoothing_window_size = NULL)
|
regions_of_interest |
either a GRanges of regions OR a character vector of sequences/chromosomes to find the coverage for (please be careful that the names here match the spelling/format of those in the bam file). |
bam_file |
Location of the bam file from which to read coverage data. |
window_size |
The size of the window to for calculating coverage
(default is 1; per base coverage). Use |
smoothing_window_size |
If supplied, then moving average smoothing will
be applied using the |
A GRanges containing the coverage data in the metadata column 'coverage'.
The gmovizInitialise
,
drawLinegraphTrack
, insertionDiagram
and
featureDiagram
functions which can plot the coverage data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## the example .bam file
path <- system.file('extdata', 'ex1.bam', package='Rsamtools')
## example without smoothing or windowing
getCoverage(regions_of_interest='seq1', bam_file=path)
## using windowing
getCoverage(regions_of_interest='seq1', bam_file=path, window_size=5)
## using smoothing
getCoverage(regions_of_interest='seq1', bam_file=path,
smoothing_window_size=3)
## specifying only a particular region to read in using GRanges
small_range <- GRanges('seq1', IRanges(0, 500))
getCoverage(regions_of_interest=small_range, bam_file=path)
## please be very careful that the sequence names are spelled exactly like
## in the bam file or you'll get an error! The following WON'T WORK.
## Not run:
getCoverage(regions_of_interest='chr1', bam_file=path)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.