本文整理汇总了Golang中github.com/biogo/biogo/seq/linear.Seq.RevComp方法的典型用法代码示例。如果您正苦于以下问题:Golang Seq.RevComp方法的具体用法?Golang Seq.RevComp怎么用?Golang Seq.RevComp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/biogo/biogo/seq/linear.Seq
的用法示例。
在下文中一共展示了Seq.RevComp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AlignFrom
// AlignFrom performs filtering and alignment for one strand of query using the
// provided filter trapezoids as seeds.
func (p *PALS) AlignFrom(traps filter.Trapezoids, complement bool) (dp.Hits, error) {
if p.err != nil {
return nil, p.err
}
var (
working *linear.Seq
err error
)
if complement {
p.notify("Complementing query")
working = p.query.Clone().(*linear.Seq)
working.RevComp()
p.notify("Complemented query")
} else {
working = p.query
}
p.notify("Aligning")
aligner := dp.NewAligner(
p.target, working,
p.FilterParams.WordSize, p.DPParams.MinHitLength, p.DPParams.MinId,
)
aligner.Costs = &p.Costs
hits := aligner.AlignTraps(traps)
hitCoverageA, hitCoverageB, err := hits.Sum()
if err != nil {
return nil, err
}
p.notifyf("Aligned %d hits covering %d x %d", len(hits), hitCoverageA, hitCoverageB)
return hits, nil
}
示例2: Align
// Align performs filtering and alignment for one strand of query.
func (p *PALS) Align(complement bool) (dp.Hits, error) {
if p.err != nil {
return nil, p.err
}
var (
working *linear.Seq
err error
)
if complement {
p.notify("Complementing query")
working = p.query.Clone().(*linear.Seq)
working.RevComp()
p.notify("Complemented query")
} else {
working = p.query
}
p.notify("Filtering")
err = p.hitFilter.Filter(working, p.selfCompare, complement, p.morass)
if err != nil {
return nil, err
}
p.notifyf("Identified %d filter hits", p.morass.Len())
p.notify("Merging")
merger := filter.NewMerger(p.index, working, p.FilterParams, p.MaxIGap, p.selfCompare)
var h filter.Hit
for {
if err = p.morass.Pull(&h); err != nil {
break
}
merger.MergeFilterHit(&h)
}
if err != nil && err != io.EOF {
return nil, err
}
p.err = p.morass.Clear()
p.trapezoids = merger.FinaliseMerge()
lt, lq := p.trapezoids.Sum()
p.notifyf("Merged %d trapezoids covering %d x %d", len(p.trapezoids), lt, lq)
p.notify("Aligning")
aligner := dp.NewAligner(
p.target, working,
p.FilterParams.WordSize, p.DPParams.MinHitLength, p.DPParams.MinId,
)
aligner.Costs = &p.Costs
hits := aligner.AlignTraps(p.trapezoids)
hitCoverageA, hitCoverageB, err := hits.Sum()
if err != nil {
return nil, err
}
p.notifyf("Aligned %d hits covering %d x %d", len(hits), hitCoverageA, hitCoverageB)
return hits, nil
}