// UngappedPositionSlice returns a slice that counts only over characters
// that does not match the gap character in the sequence.
// If a character matches the gap character, -1 is inserted instead of the
// ungapped count.
UngappedPositionSlice returns a slice that counts only over characters
that does not match the gap character in the sequence.
If a character matches the gap character, -1 is inserted instead of the
ungapped count.
// UngappedPositionSlice returns a slice that counts only over characters // that does not match the gap character in the sequence . // If a character matches the gap character - 1 is inserted instead of the // ungapped count .
func (s *CharSequence) UngappedPositionSlice(gapChar string) (arr []int) {
	gapRune := []rune(gapChar)[0]
	cnt := 0
	for _, s := range []rune(s.sequence) {
		if s != gapRune {
			arr = append(arr, cnt)
			cnt++
		} else {
			arr = append(arr, -1)
		}
	}
	return
}
func ( s * CharSequence ) UngappedPositionSlice ( gapChar string ) ( arr [ ] int ) { gapRune := [ ] rune ( gapChar ) [ 0 ] cnt := 0 for _ , s := range [ ] rune ( s . sequence ) { if s != gapRune { arr = append ( arr , cnt ) cnt ++ } else { arr = append ( arr , - 1 ) } } return }
UngappedPositionSlice returns a slice that counts only over characters
that does not match the gap character in the sequence.
UngappedPositionSlice returns a slice that counts only over characters that does not match the gap character in the sequence .
// Assumes gapChar contains only a "single character" // Convert single character string to rune slice, taking the first item // If sequence rune is not a gap character rune, append current count value to array and increment // If it is equal to the gap character rune, then append a -1. // Do not increment.