Пример #1
0
// Set the error probability to e at position pos.
func (q *Phred) SetE(i int, e float64) error {
	q.Qual[i-q.Offset] = alphabet.Ephred(e)
	return nil
}
Пример #2
0
		for _, l := range c {
			if alpha.IsValid(l) {
				w[alpha.IndexOf(l)]++
			}
		}

		var max, maxi int
		for i, v := range w {
			if v > max {
				max, maxi = v, i
			}
		}

		return alphabet.QLetter{
			L: alpha.Letter(maxi),
			Q: alphabet.Ephred(1 - (float64(max) / float64(len(c)))),
		}
	}

	// A default ConsenseFunc function that takes letter quality into account.
	// http://staden.sourceforge.net/manual/gap4_unix_120.html
	DefaultQConsensus ConsenseFunc = func(a Aligned, alpha alphabet.Alphabet, pos int, fill bool) alphabet.QLetter {
		w := make([]float64, alpha.Len())
		for i := range w {
			w[i] = 1
		}

		others := float64(alpha.Len() - 1)
		c := a.ColumnQL(pos, fill)
		for _, l := range c {
			if alpha.IsValid(l.L) {
Пример #3
0
// SetE sets the quality at position pos to e to reflect the given p(Error).
func (s *QSeq) SetE(i int, e float64) error {
	s.Seq[i-s.Offset].Q = alphabet.Ephred(e)
	return nil
}
Пример #4
0
// SetE sets the quality at position i to e to reflect the given p(Error).
func (r QRow) SetE(i int, e float64) error {
	r.Align.Seq[i-r.Align.Offset][r.Row].Q = alphabet.Ephred(e)
	return nil
}