Utility

Types

PanGraph.Graphs.Utility.ScoreType
struct Score <: AbstractArray{Float64,2}
	rows::Int
	cols::Int
	band::NamedTuple{(:lower, :upper)}
	data::Array{Float64}
	offset::Array{Int}
	starts::Array{Int}
	stops::Array{Int}
end

Store information about a banded pairwise alignment.

source
PanGraph.Graphs.Utility.costConstant
cost = (
	open   = -6.0,
	extend = -1.0,
	band   = (
		lower = Inf,
		upper = Inf,
	),
	gap    = k -> k == 0 ? 0 : cost.open + cost.extend*(k-1),
	match  = (c₁, c₂) -> 6.0*(c₁ == c₂) - 3.0,
)

cost are the default dynamic alignment parameters used.

source

Functions

PanGraph.Graphs.Utility.alignMethod
align(seq₁::Array{UInt8}, seq₂::Array{UInt8}, cost::Score)

Perform a pairwise alignment using Needleman-Wunsch style dynamic programming between seq₁ and seq₂ given cost. The cost is defined by the Score structure.

source
PanGraph.Graphs.Utility.cigarMethod
cigar(seq₁::Array{UInt8}, seq₂::Array{UInt8})

Given two sequences, seq₁ and seq₂, perform a pairwise banded alignment and return the cigar string of alignment.

source
PanGraph.Graphs.Utility.enforce_cutoff!Method
enforce_cutoff!(a::Alignment, χ)

Ensure that the alignment a does not have insertion or deletion segments larger than χ. Return the list of segments created by parsing the alignment such that all segments are larger than χ.

source
PanGraph.Graphs.Utility.hamming_alignMethod
hamming_align(qry::Array{UInt8,1}, ref::Array{UInt8,1})

Perform a simple alignment of qry to ref by minimizing hamming distance. Useful for fast, approximate alignments of small sequences.

source