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

View source: R/dataPlot.R

dataPlotR Documentation

Plot different graphs depending on the current step of KnowSeq pipeline.

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

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

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")

CasedUgr/KnowSeq documentation built on Aug. 16, 2022, 6:19 a.m.