plotDiscriminantPower: Plots the genes' Discriminant Power.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/functions.public.R

Description

Calculates and plots the Discriminant Power of the genes in the given classifier.

Usage

1
2
3
plotDiscriminantPower(classifier, classificationGenes = NULL, 
geneLabels = NULL, classNames = NULL, plotDP = TRUE, 
fileName = NULL, returnTable = FALSE, verbose = TRUE)

Arguments

classifier

Classifier returned by geNetClassifier. (@classifier)

classificationGenes

Vector or Matrix. IDs of the genes to plot.
If matrix: genes should be ordered by classes. Columns should be named after the classes.

geneLabels

Vector or Matrix. Gene name, ID or label which should be shown in the returned results and plots.

classNames

Named vector. Short version of the class names if different from the ones used to train the classifier.

plotDP

Logical. If TRUE, plots the discriminant power of the given genes.

fileName

Character. File name to save the plot with. If not provided, the plots will be shown through the standard output device.

returnTable

Logical. If TRUE, returns a table with the genes discriminant power.

verbose

Logical. If TRUE, messages indicating the execution progress will be printed on screen.

Details

The Discriminant Power represents the weight the (SVM) classifier gives each gene to separate the classes. It is calculated based on the coordinates of the support vectors. Genes with a high Discriminant Power are better for identifying samples from the class.

Value

Author(s)

Bioinformatics and Functional Genomics Group. Centro de Investigacion del Cancer (CIC-IBMCC, USAL-CSIC). Salamanca. Spain

See Also

Main package function and classifier training: geNetClassifier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
######
# Load data and train a classifier
######

# Load an expressionSet:
library(leukemiasEset)
data(leukemiasEset)

# Select the train samples: 
trainSamples<- c(1:10, 13:22, 25:34, 37:46, 49:58) 
# summary(leukemiasEset$LeukemiaType[trainSamples])

# Train a classifier or load a trained one:
# leukemiasClassifier <- geNetClassifier(leukemiasEset[,trainSamples], 
#    sampleLabels="LeukemiaType", plotsName="leukemiasClassifier") 
data(leukemiasClassifier) # Sample trained classifier

######
# Discriminant Power
######
# Default (plots up to 20 genes)
plotDiscriminantPower(leukemiasClassifier)
# Plot a specific gene:
plotDiscriminantPower(leukemiasClassifier, classificationGenes="ENSG00000169575")
# Plot top5 genes of a class, and return their discriminant power:
# Note: The discriminant Power can only be calculated for 'classificationGenes' 
#            (genes chosen for training the classifier)
genes <- getRanking(leukemiasClassifier@classificationGenes, 
    showGeneID=TRUE)$geneID[1:5,"AML",drop=FALSE] # Top 5 genes of AML
discPowerTable2 <- plotDiscriminantPower(leukemiasClassifier, 
    classificationGenes=genes, returnTable=TRUE)

# For plotting more than 20 genes or saving the plots as .pdf, provide a fileName
plotDiscriminantPower(leukemiasClassifier, 
     fileName="leukemiasClassifier_DiscriminantPower.pdf")

geNetClassifier documentation built on Nov. 8, 2020, 4:53 p.m.