Description Usage Arguments Value Examples
View source: R/plot_correlation.R
Function to calculate correlations of ChIP/ATAC-seq
enrichment among replicates/samples or groups.
The function is compatible with the output of
multiBigwig_summary
or any custom data.frame
with the similar format.
1 2 3 | plot_correlation(enrichments_df, log_transform = TRUE,
method = "pearson", plot_type = "replicate_level", sample_metadata,
...)
|
enrichments_df |
dataframe of enrichments, usually in the form of the output from function |
log_transform |
logical, whether to log2 transform |
method |
method to calculate correlation coefficient, one of |
plot_type |
whether to plot |
sample_metadata |
a data.frame required if |
... |
additional arguments either to |
corrplot or ggplot2 object
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 | ## load example data
## load example data
chr21_data_table <- system.file('extdata/bw', 'ALPS_example_datatable.txt', package = 'ALPS', mustWork = TRUE)
## attach path to bw_path and bed_path
d_path <- dirname(chr21_data_table)
chr21_data_table <- read.delim(chr21_data_table, header = TRUE)
chr21_data_table$bw_path <- paste0(d_path, '/', chr21_data_table$bw_path)
chr21_data_table$bed_path <- paste0(d_path, '/', chr21_data_table$bed_path)
enrichments <- multiBigwig_summary(data_table = chr21_data_table,
summary_type = 'mean',
parallel = TRUE)
## replicate_level correlation plot
plot_correlation(enrichments_df = enrichments,
log_transform = TRUE, plot_type = 'replicate_level',
sample_metadata = chr21_data_table)
## group_level correlation plot
plot_correlation(enrichments_df = enrichments,
log_transform = TRUE, plot_type = 'group_level',
sample_metadata = chr21_data_table)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.