Beispiel #1
0
func (self *Multi) At(pos seq.Position) alphabet.QLetter {
	var count int
	for _, s := range self.S {
		count = s.Count()
		if pos.Ind < count {
			return s.At(pos)
		}
		pos.Ind -= count
	}

	panic("index out of range")
}
Beispiel #2
0
func (self *Multi) Set(pos seq.Position, l alphabet.QLetter) {
	var count int
	for _, s := range self.S {
		count = s.Count()
		if pos.Ind < count {
			s.Set(pos, l)
			return
		}
		pos.Ind -= count
	}

	panic("index out of range")
}
Beispiel #3
0
func (self *Multi) SetE(pos seq.Position, q float64) {
	var count int
	for _, s := range self.S {
		if a, ok := s.(seq.Counter); ok {
			count = a.Count()
		} else {
			count = 1
		}
		if pos.Ind < count {
			if qs, ok := s.(seq.Quality); ok {
				qs.SetE(pos, q)
				return
			}
		}
		pos.Ind -= count
	}

	panic("index out of range")
}
Beispiel #4
0
func (self *Multi) EAt(pos seq.Position) float64 {
	var count int
	for _, s := range self.S {
		if a, ok := s.(seq.Counter); ok {
			count = a.Count()
		} else {
			count = 1
		}
		if pos.Ind < count {
			if qs, ok := s.(seq.Quality); ok {
				return qs.EAt(pos)
			} else {
				return protein.DefaultQphred.ProbE()
			}
		}
		pos.Ind -= count
	}

	panic("index out of range")
}