View source: R/plothistoknee.R
plothistoknee | R Documentation |
This function generates a histogram showing the distribution of the distance from the transcription start site (TSS) to the knee point for attenuated genes. The distance can be plotted either as a percentage of the gene length or in kilobases (kb).
plothistoknee(unigroupdf, plottype = "percent", xlimvec = NA,
binwidthval = NA, kneename = "knee_AUC_HS", plot = FALSE, outfold = tempdir(),
formatname = "pdf", universename = "Universe", groupname = "Group",
verbose = TRUE)
unigroupdf |
A data frame containing gene-level statistics, including knee point data and group classification (see universegroup). |
plottype |
A string specifying the type of distance to plot. Options are
|
xlimvec |
A numeric vector of length 2 specifying the limits of the
x-axis. Default is |
binwidthval |
A numeric value for the width of the bins in the
histogram. Default is |
kneename |
A string specifying the name of the column in
|
plot |
A logical flag indicating whether to display the plot
interactively ( |
outfold |
A string specifying the output folder where the plot will be
saved if |
formatname |
A string specifying the format of the saved plot file.
Default is |
universename |
A string specifying the name of the column in
|
groupname |
A string specifying the name of the column in
|
verbose |
A logical flag indicating whether to display detailed
messages about the function's progress. Default is |
A histogram showing the distribution of the distance from the TSS to the knee point for attenuated genes. The plot can either be displayed interactively or saved to a file.
[universegroup]
exppath <- system.file("extdata", "exptab.csv", package="tepr")
transpath <- system.file("extdata", "cugusi_6.tsv", package="tepr")
expthres <- 0.1
## Calculating necessary results
expdf <- read.csv(exppath)
transdf <- read.delim(transpath, header = FALSE)
avfilt <- averageandfilterexprs(expdf, transdf, expthres,
showtime = FALSE, verbose = FALSE)
rescountna <- countna(avfilt, expdf, nbcpu = 1, verbose = FALSE)
ecdf <- genesECDF(avfilt, expdf, verbose = FALSE)
resecdf <- ecdf[[1]]
nbwindows <- ecdf[[2]]
resmeandiff <- meandifference(resecdf, expdf, nbwindows,
verbose = FALSE)
bytranslistmean <- split(resmeandiff, factor(resmeandiff$transcript))
resknee <- kneeid(bytranslistmean, expdf, verbose = FALSE)
resauc <- allauc(bytranslistmean, expdf, nbwindows, verbose = FALSE)
resatt <- attenuation(resauc, resknee, rescountna, bytranslistmean, expdf,
resmeandiff, verbose = FALSE)
resug <- universegroup(resatt, expdf, verbose = FALSE)
## Testing plothistoknee
plothistoknee(resug, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.