View source: R/rnaseq_related.R
plot_deg_upsets | R Documentation |
For a given set of DEG comparisons, the functions returns UpSetR::upset()
plots for up and down genes between any 2 comparisons.
For each upset plot generated function also returns interaction between gene sets in form of dataframe.
plot_deg_upsets(
x,
sample_comparisons,
color_up = "#b30000",
color_down = "#006d2c"
)
x |
x an abject of class "parcutils". This is an output of the function |
sample_comparisons |
a character vector denoting sample comparisons between upset plot to be generated. |
color_up |
a character string denoting a valid color code for bars in upset plot for up regulated genes. |
color_down |
a character string denoting a valid color code for bars in upset plot for down regulated genes. |
an object of named list where each element is a list of two - 1) an upset plots UpSetR::upset()
and their intersections in form of tibble.
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"))
yy <- plot_deg_upsets(x= res, sample_comparisons = c("treatment1_VS_control","treatment2_VS_control"))
yy[[1]]$upset_plot %>% print()
yy[[1]]$upset_intersects %>% print()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.