TP_FP_FN_avg_sim: Return the numbers of true positives (TP), false positives...

Description Usage Arguments Details Value Examples

View source: R/TP_FP_FN_avg_sim.R

Description

Return the numbers of true positives (TP), false positives (FP), false negatives (FN), and average cosine similarity between extracted and ground truth signatures.

Usage

1
TP_FP_FN_avg_sim(extracted.sigs, ground.truth.sigs, similarity.cutoff = 0.9)

Arguments

extracted.sigs

Mutational signatures discovered by some analysis. A numerical-matrix-like object with columns as signatures.

ground.truth.sigs

Ground-truth mutational signatures from a synthetic data set. A numerical-matrix-like object with columns as signatures.

similarity.cutoff

A signature in ground.truth.sigs must be matched by >= similarity.cutoff by a signature in extracted.sigs to be considered detected.

Details

Match signatures in extracted.sigs to signatures in ground.truth.sigs using the function solve_LSAP, which uses the "Hungarian" (a.k.a "Kuhn–Munkres") algorithm https://en.wikipedia.org/wiki/Hungarian_algorithm, which optimizes the total cost associated with the links between nodes. The function first computes the all-pairs cosine similarity matrix between the two sets of signatures, then converts cosine similarities to cosine distances (including similarity.cutoff) by subtracting from 1, then sets distances > the converted cutoff to very large values. It then applies solve_LSAP to the resulting matrix to compute an optimal matching between extracted.sigs and ground.truth.sigs.

Value

A list with the elements

Examples

1
2
3
4
5
6
7
ex.sigs <- matrix(c(0.2, 0.8, 0.3, 0.7, 0.6, 0.4), nrow = 2)
colnames(ex.sigs) <- c("ex1", "ex2", "ex3")
gt.sigs <- matrix(c(0.21, 0.79, 0.19, 0.81), nrow = 2)
colnames(gt.sigs) <- c("gt1", "gt2")
TP_FP_FN_avg_sim(extracted.sigs     = ex.sigs,
                 ground.truth.sigs = gt.sigs,
                 similarity.cutoff = .9)

steverozen/ICAMSxtra documentation built on Feb. 9, 2022, 7:01 a.m.