Description Usage Arguments Value See Also Examples
Given a dataframe of samples and distance based annotation, the function calculates the distribution of data in or around the given annotation. From genomic point of view, the function can be used to identify distribution of data around genomic features like gene TSS, CpG island, etc.
1 2 3 4 5 6 7 8 9 10 11 |
dat |
a dataframe/GRanges with required columns to make the plot. |
grouping |
name of the column grouping the data or denoting the samples |
annotCol |
name of the column holding the distance to feature data. This can also be boolean data in which case plot will be in/out of feature. |
breaks |
intervals by which to break up the distance data. Default is seq(-1e5,1e5,5e3). Not required if 'annotCol' is of type boolean. |
discreteBins |
whether to plot continuous variable supplied in annotCol as a discrete axis. This conserves plotting area, thus default is TRUE. |
geom |
plot distribution using bars or lines? Default is 'bar'. One can use 'line' as well when there are many groups. |
stacked |
make a stacked plot? Only applies when geom is 'bar'. Default is FALSE. |
typeRatio |
whether to plot data as ratio of experimental to controls. Default is FALSE. Enabling this requires a column in 'dat' called "type" with two values "expr" for experimental and "ctrl" for control. This column subdivides data within each group. Enabling this transforms the data into plotting distribution of ratios of experimental/controls around feature of interest. |
printPlotData |
return summarized plot data? Default is FALSE. |
ggplot2 plot and/or table of summarized plot data.
makeGRanges
, getNearestFeature
,
getSitesInFeature
, getFeatureCounts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Convert a dataframe to GRanges object
data(sites)
data(sites.ctrl)
sites$type <- "expr"
sites <- rbind(sites,sites.ctrl)
alldata.rd <- makeGRanges(sites,soloStart=TRUE)
data(genes)
genes.rd <- makeGRanges(genes)
res <- doAnnotation(annotType="within", alldata.rd, genes.rd, "InGene",
asBool=TRUE)
plotdisFeature(res, "virus", "InGene")
plotdisFeature(res, "virus", "InGene", typeRatio=TRUE)
## Not run:
res <- doAnnotation(annotType="nearest", res, genes.rd, "NearestGene",
side='5p')
plotdisFeature(res, "virus", "X5pNearestGeneDist")
plotdisFeature(res, "virus", "X5pNearestGeneDist", typeRatio=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.