eigenDecomposition: MiRNAss: Genome-wide pre-miRNA discovery from few labeled...

Description Usage Arguments Value Examples

View source: R/eigenDecomposition.R

Description

This funtions calculate the eigenvectors and eigen values of the Laplacian of the graph. As this proccess is quite time comsumin, this functions allows to obtain this decomposition once and the be able to run miRNAss several times in shorter times.

Usage

1
eigenDecomposition(AdjMatrix, nEigenVectors)

Arguments

AdjMatrix

Adjacency sparse matrix of the graph.

nEigenVectors

Number of eigen vectors.

Value

Returns the eigen descomposition as a list with two elements: The eigen vectors matrix 'U' and the eigen values vector 'D'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# First construct the label vector with the CLASS column
y = as.numeric(celegans$CLASS)*2 - 1

# Remove some labels to make a test
y[sample(which(y>0),200)] = 0
y[sample(which(y<0),700)] = 0

# Take all the features but remove the label column
x = subset(celegans, select = -CLASS)

A = adjacencyMatrixKNN(x, y, 10, 8)
E = eigenDecomposition(AdjMatrix = A, nEigenVectors = 100)
for (mp in c(0.1,1,10)) {
    p = miRNAss(sequenceLabels = y, AdjMatrix = A,
                eigenVectors = E, missPenalization = mp)
    # Calculate some performance measures
    SE = mean(p[ celegans$CLASS & y==0] > 0)
    SP = mean(p[!celegans$CLASS & y==0] < 0)
    cat("mP: ", mp, "\n  SE: ", SE, "\n  SP:   ", SP, "\n")
}

cyones/miRNAss documentation built on Oct. 24, 2020, midnight