dp

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: BSD-3-Clause Imports: 6 Imported by: 9

Documentation

Overview

Package providing PALS dynamic programming alignment routines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aligner

type Aligner struct {
	Costs *Costs
	// contains filtered or unexported fields
}

An Aligner provides allows local alignment of subsections of long sequences.

func NewAligner

func NewAligner(target, query *linear.Seq, k, minLength int, minId float64) *Aligner

Create a new Aligner based on target and query sequences.

func (*Aligner) AlignTraps

func (a *Aligner) AlignTraps(trapezoids filter.Trapezoids) Hits

Align pairs of sequence segments defined by trapezoids. Returns aligning segment pairs satisfying length and identity requirements.

type Costs

type Costs struct {
	MaxIGap    int
	DiffCost   int
	SameCost   int
	MatchCost  int
	BlockCost  int
	RMatchCost float64
}

A Costs specifies dynamic programming behaviour.

type Hit

type Hit struct {
	Abpos, Bbpos              int     // Start coordinate of local alignment
	Aepos, Bepos              int     // End coordinate of local alignment
	LowDiagonal, HighDiagonal int     // Alignment is between (anti)diagonals LowDiagonal & HighDiagonal
	Score                     int     // Score of alignment where match = SameCost, difference = -DiffCost
	Error                     float64 // Lower bound on error rate of match
}

Hit holds details of alignment result.

type Hits

type Hits []Hit

DPHits is a collection of alignment results.

func (Hits) Sum

func (h Hits) Sum() (a, b int, err error)

Returns the sums of alignment lengths.

type Params

type Params struct {
	MinHitLength int
	MinId        float64
}

A Params holds dynamic programming alignment parameters.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL