plotauc | R Documentation |
This function generates scatterplots comparing the area under the curve (AUC) for control and stress conditions, with an option to highlight specific genes or groups. The plot can be saved as a file or displayed interactively.
plotauc(tab, expdf, genevec = NA, auc_ctrlname = "AUC_ctrl",
auc_stressname = "AUC_HS",
pvalkstestcolname = "adjFDR_p_dAUC_Diff_meanFx_HS_ctrl",
labelx = "AUC in Control", labely = "AUC in Stress", axismin_x = -10,
axismax_x = 100, axismin_y = -10, axismax_y = 100, maintitle = "",
subtitle = "", legendpos = "bottom", formatname = "pdf", outfold = tempdir(),
outfile = "AUCcompare_pval", plottype = "pval", plot = FALSE,
universename = "Universe", groupname = "Group", verbose = TRUE)
tab |
A data frame containing the AUC values for control and stress conditions, and other columns required for plotting (e.g., p-values or group memberships, see allauc). |
expdf |
A data frame containing experiment data that should have columns named 'condition', 'replicate', 'strand', and 'path'. |
genevec |
A vector of gene names to highlight on the plot, applicable
when |
auc_ctrlname |
The column name in |
auc_stressname |
The column name in |
pvalkstestcolname |
The column name in |
labelx |
Label for the x-axis. Default is |
labely |
Label for the y-axis. Default is |
axismin_x |
Minimum value for the x-axis. Default is |
axismax_x |
Maximum value for the x-axis. Default is |
axismin_y |
Minimum value for the y-axis. Default is |
axismax_y |
Maximum value for the y-axis. Default is |
maintitle |
Main title of the plot. Default is an empty string. |
subtitle |
Subtitle of the plot. Default is an empty string. |
legendpos |
Position of the legend. Default is |
formatname |
Format of the saved plot (e.g., "pdf", "png"). Default is
|
outfold |
Output folder where the plot will be saved. Default is
|
outfile |
Name of the output file. Default is
|
plottype |
Type of plot to generate. Can be |
plot |
A logical flag indicating whether to display the plot
interactively ( |
universename |
Column name in |
groupname |
Column name in |
verbose |
A logical flag indicating whether to display detailed
messages about the function's progress. Default is |
The function supports two plot types:
"pval"
: The plot highlights genes based on adjusted FDR
p-values and can highlight specific genes provided in genevec
.
"groups"
: The plot highlights predefined groups, such as
"Attenuated" and "Outgroup", within the data.
If plot = TRUE
, the plot is displayed interactively. If
plot = FALSE
, the plot is saved to a file in the specified format and
output folder.
A plot comparing AUC values between control and stress conditions, either displayed or saved to a file.
[allauc]
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 plotauc
plotauc(resug, expdf, plottype = "groups", plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.