pca_plot: pca_plot

Description Usage Arguments Value Examples

View source: R/visualization_functions.R

Description

pca_plot

Usage

1
pca_plot(results, overlaid.info, sample.names = NULL, show.names = TRUE)

Arguments

results

cinaR result object

overlaid.info

overlaid information onto the samples

sample.names

names of the samples shown on pca plot

show.names

logical, if set FALSE sample names will be hidden

Value

ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#' library(cinaR)
data(atac_seq_consensus_bm) # calls 'bed'

# creating dummy results
results <- NULL
results[["cp"]] <- bed[,c(4:25)]

# a vector for comparing the examples
contrasts <- sapply(strsplit(colnames(bed), split = "-", fixed = TRUE),
                    function(x){x[1]})[4:25]

## overlays the contrasts info onto PCA plots
pca_plot(results, contrasts)

## you can overlay other information as well,
## as long as it is the same length with the
## number of samples.

sample.info <- c(rep("Group A", 11), rep("Group B", 11))
pca_plot(results, sample.info, show.names = FALSE)

cinaR documentation built on April 2, 2021, 5:06 p.m.