getBaseGapPenaltyCpp {DIAlignR} | R Documentation

## Calculates gap penalty for dynamic programming based alignment.

### Description

This function outputs base gap-penalty depending on SimType used. In case of getting base gap-penalty from similarity matrix distribution, gapQuantile will be used to pick the value.

### Usage

    getBaseGapPenaltyCpp(sim, SimType, gapQuantile = 0.5)

### Arguments

`sim` | (matrix) A numeric matrix. Input similarity matrix.
`SimType` | (char) A character string. Similarity type must be selected from (dotProductMasked, dotProduct, cosineAngle, cosine2Angle, euclideanDist, covariance, correlation).
`gapQuantile` | (numeric) Must be between 0 and 1.

### Value

baseGapPenalty (numeric).

### Author(s)

Shubham Gupta, shubh.gupta@mail.utoronto.ca ORCID: 0000-0003-3500-8152 License: (c) Author (2019) + MIT Date: 2019-03-08

### Examples

    sim <- matrix(c(-12, 1.0, 12, -2.3, -2, -2, 1.07, -2, 1.80, 2, 22, 42, -2, -1.5, -2, 10), 4, 4,
     byrow = FALSE)
    getBaseGapPenaltyCpp(sim, "dotProductMasked", 0.5) # -0.25

[Package DIAlignR version 1.2.0 Index]