dataPlot: Plot different graphs depending on the current step of...

Description Usage Arguments Value Examples

View source: R/dataPlot.R

Description

This function allows to plot different charts only by changing the parameters, for the different KnowSeq pipeline steps. Furthermore, the chosen plot can be saved to PNG and PDF.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
dataPlot(
  data,
  labels,
  colours = c("red", "green"),
  main = "",
  ylab = "Expression",
  xlab = "Samples",
  xgrid = FALSE,
  ygrid = FALSE,
  legend = "",
  mode = "boxplot",
  heatmapResultsN = 0,
  toPNG = FALSE,
  toPDF = FALSE
)

Arguments

data

Normally, the data parameter is an expression matrix or data.frame, however for the confusionMatrix plot, the data are a confussion matrix that can be achieved by using the output of any of the machine learning functions of this package.

labels

A vector or factor that contains the labels for each of the samples in the data parameter.

colours

A vector that contains the desired colours to plot the different charts. Example: c("red","green","blue").

main

The title for the plot.

ylab

The description for the y axis.

xlab

The description for the x axis.

xgrid

Shows the x grid into the plot

ygrid

Shows the y grid into the plot

legend

A vector with the elements in the legend of the plot.

mode

The different plots supported by this package. The possibilities are boxplot, orderedBoxplot, genesBoxplot, heatmap, confusionMatrix, classResults and heatmapResults.

heatmapResultsN

Number of genes to show when mode is equal to heatmapResults.

toPNG

Boolean variable to indicate if a plot would be save to PNG.

toPDF

Boolean variable to indicate if a plot would be save to PDF.

Value

Nothing to return.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dir <- system.file("extdata", package="KnowSeq")
load(paste(dir,"/expressionExample.RData",sep = ""))

dataPlot(expressionMatrix,labels,mode = "boxplot",toPNG = TRUE,toPDF = TRUE)
dataPlot(DEGsMatrix[1:12,],labels,mode = "orderedBoxplot",toPNG = TRUE,toPDF = TRUE)
dataPlot(DEGsMatrix[1:12,],labels,mode = "genesBoxplot",toPNG = TRUE,toPDF = FALSE)
dataPlot(DEGsMatrix[1:12,],labels,mode = "heatmap",toPNG = TRUE,toPDF = TRUE)

results <- knn_trn(t(DEGsMatrix), labels, rownames(DEGsMatrix), 3)
dataPlot(results, labels = "", mode = "heatmapResults", main = "Plot to show indicators of trained model")

KnowSeq documentation built on April 16, 2021, 6:01 p.m.