Documentation
ΒΆ
Overview ΒΆ
Package providing PALS sequence hit filter routines based on 'Efficient q-gram filters for finding all π-matches over a given length.'
Kim R. Rasmussen, Jens Stoye, and Eugene W. Myers. J. of Computational Biology 13:296β308 (2006).
Index ΒΆ
Constants ΒΆ
This section is empty.
Variables ΒΆ
var ( MaxIGap int = 5 DiffCost int = 3 SameCost int = 1 MatchCost int = DiffCost + SameCost BlockCost int = DiffCost * MaxIGap RMatchCost float64 = float64(DiffCost) + 1 )
Default global parameters
Functions ΒΆ
func MinWordsPerFilterHit ΒΆ
Ukonnen's Lemma: U(n, q, π) := (n + 1) - q(βπnβ + 1)
Types ΒΆ
type Filter ΒΆ
type Filter struct {
// contains filtered or unexported fields
}
Filter implements a q-gram filter similar to that described in Rassmussen 2005. This implementation is a translation of the C++ code written by Edgar and Myers.
func (*Filter) Filter ΒΆ
func (self *Filter) Filter(query *seq.Seq, selfAlign, complement bool, morass *morass.Morass) (err error)
Filter a query sequence against the stored index. If query and the target are the same sequence, selfAlign can be used to avoid double seaching - behavior is undefined if the the sequences are not the same. A morass is used to store and sort individual filter hits.
type FilterHit ΒΆ
Type to store individual q-gram filter hits.
func (FilterHit) Less ΒΆ
This is a direct translation of the qsort compar function used by PALS. However it results in a different sort order (with respect to the non-key fields) for FilterHits because of differences in the underlying sort algorithms and their respective sort stability. This appears to have some impact on FilterHit merging.
type Merger ΒΆ
type Merger struct {
// contains filtered or unexported fields
}
A Merger aggregates and clips an ordered set of trapezoids.
func NewMerger ΒΆ
func NewMerger(index *kmerindex.Index, query *seq.Seq, filterParams *Params, selfCompare bool) (m *Merger)
Create a new Merger using the provided kmerindex, query sequence and filter parameters. If selfCompare is true only the upper diagonal of the comparison matrix is checked to save time.
func (*Merger) FinaliseMerge ΒΆ
func (self *Merger) FinaliseMerge() (trapezoids Trapezoids)
Finalise the merged collection and return a sorted slice of Trapezoids.
func (*Merger) MergeFilterHit ΒΆ
Merge a filter hit into the collection.
type Trapezoid ΒΆ
type Trapezoid struct {
Next *Trapezoid // Organized in a list linked on this field
Top, Bottom int // B (query) coords of top and bottom of trapzoidal zone
Left, Right int // Left and right diagonals of trapzoidal zone
}
Type to store a successfully filtered w Γ e Parallelogram
type Trapezoids ΒΆ
type Trapezoids []*Trapezoid
Trapezoid slice type used for sorting Trapezoids during merge.
func (Trapezoids) Sum ΒΆ
func (self Trapezoids) Sum() (a, b int)
Return the sum of all Trapezoids in the slice.