本文整理匯總了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
}