get_corr_heatbox: Generate a correlation heat plot.

View source: R/viz_related.R

get_corr_heatboxR Documentation

Generate a correlation heat plot.

Description

For all (or selected) samples this function generate a correlation heat box type plot.

Usage

get_corr_heatbox(
  x,
  samples = NULL,
  genes = NULL,
  corr_method = "pearson",
  plot_type = "full",
  vis_method = "square",
  show_diagonal = TRUE,
  show_corr_values = FALSE,
  col_corr_values = "yellow",
  size_corr_values = 5,
  cluster_samples = FALSE,
  scale_range = NULL
)

Arguments

x

an object of class parcutils.

samples

a character vector denoting samples to plot in scatter plot, default NULL. If set to NULL all samples are accounted.

genes

a character vector denoting genes to consider in scatter plot, default NULL. If set to NULL all genes are accounted.

corr_method

a character string, default "pearson", denoting a value for correlation method. Value can be one of these "pearson", "kendall", "spearman".

plot_type

a character string, default "square", denoting value for plot type. Value can be one of these "full", "lower", "upper".

vis_method

a character string, default "full", denoting a value type of visualization. Value can be one of these "square", "circle".

show_diagonal

a logical, default TRUE, denoting whether to show diagonal values or not.

show_corr_values

a logical, default TRUE, denoting whether to show corr values or not.

col_corr_values

a character string, default "yellow", denoting a valid color string for corr values.

size_corr_values

a numeric, default 5, denoting a size for corr values.

cluster_samples

a logical, default TRUE, denoting whether to cluster samples or not.

scale_range

a numeric vector of length two denoting minimum and maximum value for the color scale, default NULL.

Value

a corr plot.

Examples

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"))

get_corr_heatbox(res,samples = c("treatment1","control"),cluster_samples = FALSE,show_corr_values =TRUE,
size_corr_values = 4)

cparsania/parcutils documentation built on Oct. 27, 2024, 4:55 a.m.