exploreDDSplot: exploreDDSplot

Description Usage Arguments Value Examples

View source: R/runPlots.R

Description

Scatterplot of transformed counts from two samples or grid of all samples

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
exploreDDSplot(
  countMatrix,
  targets,
  cmp = cmp[[1]],
  preFilter = NULL,
  samples,
  scattermatrix = FALSE,
  plotly = FALSE,
  savePlot = FALSE,
  filePlot = NULL
)

Arguments

countMatrix

date.frame or matrix containing raw read counts

targets

targets data.frame

cmp

character matrix where comparisons are defined in two columns. This matrix should be generated with the systemPipeR::readComp() function from the targets file. Values used for comparisons need to match those in the Factor column of the targets file.

preFilter

allows removing rows in which there are very few reads. Accepts a numeric value with the minimum of total reads to keep. Default is NULL.

samples

a character vector of two samples or ALL samples in the dataset. Could be specified the SampleName column name of the targets file or the respective numeric values. Also, if set as ALL, a correlation matrix it will be plot.

scattermatrix

if samples set as ALL, requires to assign TRUE to build a correlation matrix and plot the correlogram of all the samples.

plotly

logical: when FALSE (default), the ggplot2 plot will be returned. TRUE returns the plotly version of the plot.

savePlot

logical: when FALSE (default), the plot will not be saved. If TRUE the plot will be saved, and requires the filePlot argument.

filePlot

file name where the plot will be saved. For more information, please consult the ggplot2::ggsave() function.

Value

returns an object of ggplot2 plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(systemPipeR)
## Targets file
targetspath <- system.file("extdata", "targets.txt", package="systemPipeR")
targets <- read.delim(targetspath, comment="#")
cmp <- systemPipeR::readComp(file=targetspath, format="matrix", delim="-")
## Count table file
countMatrixPath <- system.file("extdata", "countDFeByg.xls", package="systemPipeR")
countMatrix <- read.delim(countMatrixPath, row.names=1)
## Plot
exploreDDSplot(countMatrix, targets, cmp=cmp[[1]], preFilter=NULL, samples=c(3,4))
exploreDDSplot(countMatrix, targets, cmp=cmp[[1]], samples=c("M1A", "M1B"), save = TRUE,
             filePlot = "transf_deseq2.pdf")
## Plot Correlogram
exploreDDSplot(countMatrix, targets, cmp=cmp[[1]], preFilter=NULL, samples=c("M1A", "M1B"), scattermatrix=TRUE)

systemPipeR/spsBio documentation built on Oct. 2, 2020, 9:30 a.m.