Description Usage Arguments Value Author(s) See Also Examples
Function to visualize the distribution of reads across different feature types
for many alignment files in parallel. The plots are stacked bar plots
representing the raw or normalized read counts for the sense and antisense
strand of each feature. The graphics results are generated with
ggplot2
. Typically, the expected input is generated with the
affiliated featuretypeCounts
function.
1 2 | plotfeaturetypeCounts(x, graphicsfile, graphicsformat = "pdf", scales = "fixed", anyreadlength = FALSE,
drop_N_total_aligned = TRUE, scale_count_val = 10^6, scale_length_val = NULL)
|
x |
|
graphicsfile |
Path to file where to write the output graphics. Note, the function returns
the graphics instructions from |
graphicsformat |
Graphics file format. Currently, supported formats are: pdf, png or jpeg. Argument accepts one of them as character string. |
scales |
Scales setting passed on to the |
anyreadlength |
If set to |
drop_N_total_aligned |
If set to |
scale_count_val |
Scales (normalizes) the read counts to a fixed value of aligned reads
in each sample such as counts per million aligned reads (default is 10^6).
For this calculation the |
scale_length_val |
Allows to adjust the raw or scaled read counts to a constant length interval
(e.g. |
The function returns bar plot graphics for aligned read counts with read
length resolution if the input contains this information and argument
anyreadlength
is set to FALSE
. If the input contains counts for
any read length and/or anyreadlength=TRUE
then there will be only one
bar per feature and sample. Due to the complexity of the plots, the results
are directly written to file in the chosen graphics format. However, the
function also returns the plotting instructions returned by ggplot2
to
display the result components using R's plotting device.
Thomas Girke
featuretypeCounts
, genFeatures
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Construct SYSargs object from param and targets files
param <- system.file("extdata", "tophat.param", package="systemPipeR")
targets <- system.file("extdata", "targets.txt", package="systemPipeR")
args <- systemArgs(sysma=param, mytargets=targets)
## Not run:
## Features from sample data of systemPipeRdata package
library(GenomicFeatures)
file <- system.file("extdata/annotation", "tair10.gff", package="systemPipeRdata")
txdb <- makeTxDbFromGFF(file=file, format="gff3", organism="Arabidopsis")
feat <- genFeatures(txdb, featuretype="all", reduce_ranges=TRUE, upstream=1000, downstream=0, verbose=TRUE)
## Generate and plot feature counts for specific read lengths
fc <- featuretypeCounts(bfl=BamFileList(outpaths(args), yieldSize=50000), grl=feat, singleEnd=TRUE, readlength=c(74:76,99:102), type="data.frame")
p <- plotfeaturetypeCounts(x=fc, graphicsfile="featureCounts.pdf", graphicsformat="pdf", scales="fixed", anyreadlength=FALSE)
## Generate and plot feature counts for any read length
fc2 <- featuretypeCounts(bfl=BamFileList(outpaths(args), yieldSize=50000), grl=feat, singleEnd=TRUE, readlength=NULL, type="data.frame")
p2 <- plotfeaturetypeCounts(x=featureCounts2, graphicsfile="featureCounts2.pdf", graphicsformat="pdf", scales="fixed", anyreadlength=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.