View source: R/rnaseq_related.R
get_fold_change_scatter_plot | R Documentation |
This function generates a scatter plot of log2 fold change values for two different comparisons.
get_fold_change_scatter_plot(
x,
sample_comparisons,
labels = NULL,
point_size = 2,
label_size = 2,
color_label = "both",
col_up = "#a40000",
col_down = "#16317d",
show_diagonal_line = TRUE,
show_correlation = TRUE,
repair_genes = TRUE
)
x |
an object of class parcutils. |
sample_comparisons |
a character vector of length 2 denoting sample comparisons to plot. |
labels |
a character vector of genes to label. Default NULL, no labels. |
point_size |
a numeric, default 2, denoting size of the points. |
label_size |
a numeric, default 2, denoting size of the labels. |
color_label |
a character string one of the "both", #both_down, or "both_up". Default |
col_up |
a character string, default |
col_down |
a character string, default |
show_diagonal_line |
a logical, default TRUE, denoting whether to show a diagonal line. |
show_correlation |
a logical, default TRUE, denoting whether to show Pearson correlation value. |
repair_genes |
a logical, default |
an object of ggplot2.
count_file <- system.file("extdata","toy_counts.txt" , package = "parcutils")
count_data <- readr::read_delim(count_file, delim = "\t")
sample_info <- count_data %>% colnames() %>% .[-1] %>%
tibble::tibble(samples = . , groups = rep(c("control" ,"treatment1" , "treatment2"), each = 3) )
res <- run_deseq_analysis(counts = count_data ,
sample_info = sample_info,
column_geneid = "gene_id" ,
group_numerator = c("treatment1", "treatment2") ,
group_denominator = c("control"))
# show common up and common down
get_fold_change_scatter_plot(x = res,
sample_comparisons = c("treatment1_VS_control",
"treatment2_VS_control"),label_size = 3)
# show common up
get_fold_change_scatter_plot(x = res,
sample_comparisons = c("treatment1_VS_control",
"treatment2_VS_control"),
color_label = "both_up",label_size = 4)
# show common down
get_fold_change_scatter_plot(x = res,
sample_comparisons = c("treatment1_VS_control",
"treatment2_VS_control"),
color_label = "both_down",label_size = 4, point_size = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.