generate_plots {GenomicOZone} | R Documentation |
Generate the plot from the processed GenomicOZone dataset object, including genome plots, chromosome plots and zone plots.
plot_genome(GOZ.ds, plot.file, alpha = 0.05, min.effect.size = 0.8, plot.width = NULL, plot.height = NULL) plot_chromosomes(GOZ.ds, plot.file, alpha = 0.05, min.effect.size = 0.8, plot.width = NULL, plot.height = NULL) plot_zones(GOZ.ds, plot.file, alpha = 0.05, min.effect.size = 0.8, log.exp = TRUE, plot.all.zones = FALSE)
GOZ.ds |
a GenomicOZong dataset object after running |
plot.file |
a output file name. The file type is "pdf". |
alpha |
a cutoff for selecting adjuted |
min.effect.size |
the minimum effect size required for an outstanding zone. The effect size for ANOVA ranging from 0 to 1 is calculated by R package sjstats (Lüdecke 2019). Default to 0.8. |
plot.width |
a numerical number to specify the width of page in the plot. Using |
plot.height |
a numerical number to specify the height of page in the plot. Using |
log.exp |
a logical indicating whether to use log-scaled activity in the plot. |
plot.all.zones |
a logical indicating whether to plot all zones into the file. If |
The three functions plot visualizations of the genome, chromosomes and zones. The R packages ggplot2
(Wickham 2016) and ggbio
(Yin et al. 2012) are used to generate the plots.
The function plot_genome
plots the genome-wide overviews with marked significant differential zones.
The function plot_chromosomes
plots the chromosome-wide heatmap of normalized and linearized activity between sorted zones and samples, visualizing the zones with significant ones marked.
The function plot_zones
plots the line chart and box-plot of the activity of the genes within each significant zone, visualizing gene activity changes over sample conditions.
The function takes an input of a object, which has been created by GOZDataSet
and and processed by GenomicOZone
. The functions accesse the object and generate visualizations. See GOZDataSet
for how to create the input object. See GenomicOZone
for how to process the input object and perform the analysis.
Lüdecke D (2019).
sjstats: Statistical Functions for Regression Models
(Version 0.17.5).
doi: 10.5281/zenodo.1284472, https://CRAN.R-project.org/package=sjstats.
Wickham H (2016).
ggplot2: Elegant Graphics for Data Analysis.
Springer-Verlag New York.
ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.
Yin T, Cook D, Lawrence M (2012).
“ggbio: an R package for extending the grammar of graphics for genomic data.”
Genome biology, 13(8), R77.
# Create an example of GOZ.ds data <- matrix(c(1,5,2,6,5,1,6,2), ncol = 2, byrow = TRUE) rownames(data) <- paste("Gene", 1:4, sep='') colnames(data) <- paste("Sample", c(1:2), sep='') colData <- data.frame(Sample_name = paste("Sample", c(1:2), sep=''), Condition = c("Cancer", "Normal")) design <- ~ Condition rowData.GRanges <- GRanges(seqnames = Rle(rep("chr1", 4)), ranges = IRanges(start = c(1,2,3,4), end = c(5,6,7,8))) names(rowData.GRanges) <- paste("Gene", 1:4, sep='') ks <- c(2) names(ks) <- "chr1" GOZ.ds <- GOZDataSet(data, colData, design, rowData.GRanges = rowData.GRanges, ks = ks) #### # Run the zoing process GOZ.ds <- GenomicOZone(GOZ.ds) #### # Generate plots plot_genome(GOZ.ds, plot.file = "Test_genome.pdf", plot.width = 15, plot.height = 4) plot_chromosomes(GOZ.ds, plot.file = "Test_chromosome.pdf", plot.width = 20, plot.height = 4) plot_zones(GOZ.ds, plot.file = "Test_zone.pdf", plot.all.zones = FALSE)