Description Usage Arguments Value Examples
Generating volcano plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | sp_volcano_plot(
data,
log2fc_var = "log2FoldChange",
fdr_var = "padj",
coordinate_flip = FALSE,
status_col_var = NULL,
significance_threshold = c(0.05, 1),
status_col_var_order = NULL,
point_color_vector = c("red", "green", "grey"),
log10_transform_fdr = TRUE,
max_allowed_log10p = Inf,
max_allowed_log2fc = Inf,
title = NULL,
point_label_var = "CTctctCT",
log2fc_symmetry = TRUE,
alpha = NA,
point_size = NA,
extra_ggplot2_cmd = NULL,
filename = NULL,
xtics_angle = 0,
x_label = "Log2 fold change",
y_label = "Negative log10 transformed qvalue",
legend.position = "top",
xintercept = "fc",
yintercept = "fdr",
...
)
|
data |
Data frame or data file (with header line, the first column will not be treated as the rowname, tab seperated) |
log2fc_var |
Name of fold change column. |
fdr_var |
Name of FDR or p-value column. |
coordinate_flip |
Default FALSE meaning |
status_col_var |
Name of the column containining labels of gene expression status like |
significance_threshold |
Set the threshold for defining DE genes in format like |
status_col_var_order |
Changing the order of status column values.
Normally, the unique values of status column would be sorted alphabetically. For example, the order of |
point_color_vector |
Color vector. Defgault 'red, green, grey' for 'up, dw, nodiff'
when |
log10_transform_fdr |
Get |
max_allowed_log10p |
Maximum allowed |
max_allowed_log2fc |
Maximum allowed |
title |
Title of picture. |
point_label_var |
Name of columns containing labels for points (representing genes, proteins or OTUs) to be labeled. Points with |
log2fc_symmetry |
Make coordiante axis symmetry to generate bettter visualization. Default TRUE. |
alpha |
Transparency of points (0-1). 0: opaque; 1: transparent. |
point_size |
Point size. Default 0.8. Accept a number of name of one column. |
extra_ggplot2_cmd |
Extra ggplot2 commands (currently unsupported) |
filename |
Output picture to given file. |
xtics_angle |
Rotation angle for a-axis. Default 0. |
x_label |
Xlab label.Default "Log2 fold change". |
y_label |
Ylab label.Default "Negative log10 transformed qvalue". |
legend.position |
Position of legend, accept top, bottom, left, right, none or c(0.8,0.8). |
xintercept |
Default 'fc' to show fold change lines. This needs |
yintercept |
Default 'fdr' to show fdr lines. This needs |
... |
Parametes given to |
A ggplot2 object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ### Generate test data
res_output <- data.frame(log2FoldChange=rnorm(3000), row.names=paste0("YSX",1:3000))
res_output$padj <- 20 ^ (-1*(res_output$log2FoldChange^2))
padj = 0.05
log2FC = 1
res_output$level <- ifelse(res_output$padj<=padj,
ifelse(res_output$log2FoldChange>=log2FC,
paste("groupA","UP"),
ifelse(res_output$log2FoldChange<=(-1)*(log2FC),
paste("groupB","UP"), "NoDiff")) , "NoDiff")
head(res_output)
volcanoPlot(res_output, )
## Not run:
input <- "KO-OE_all.txt"
volcano_plot(input,log2fc_var='Log2FoldChange',fdr_var='Padj',status_col_var='',
title="sd",label="Label",log10_transform_fdr=TRUE,point_size=5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.