示例#1
0
文件: multi.go 项目: frogs/biogo
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")
}
示例#2
0
文件: multi.go 项目: frogs/biogo
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")
}
示例#3
0
文件: multi.go 项目: frogs/biogo
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")
}
示例#4
0
文件: multi.go 项目: frogs/biogo
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")
}