// UngappedCoords returns the positions in the sequence where the character
// does not match the gap character.
UngappedCoords returns the positions in the sequence where the character
does not match the gap character.
// UngappedCoords returns the positions in the sequence where the character // does not match the gap character .
func (s *CodonSequence) UngappedCoords(gapChar string) (colCoords []int) {
	if len([]rune(gapChar))%3 != 0 {
		panic(fmt.Sprintf("Length of given gapChar \"%s\" is not equal to 3", gapChar))
	}
	set := make(map[int]struct{})
	for j, codon := range s.codons {
		if codon != gapChar {
			set[j] = struct{}{}
		}
	}
	for key := range set {
		colCoords = append(colCoords, key)
	}
	sort.Ints(colCoords)
	return
}
func ( s * CodonSequence ) UngappedCoords ( gapChar string ) ( colCoords [ ] int ) { if len ( [ ] rune ( gapChar ) ) % 3 != 0 { panic ( fmt . Sprintf ( " \" \" " , gapChar ) ) } set := make ( map [ int ] struct { } ) for j , codon := range s . codons { if codon != gapChar { set [ j ] = struct { } { } } } for key := range set { colCoords = append ( colCoords , key ) } sort . Ints ( colCoords ) return }
UngappedCoords returns the positions in the sequence where the character
does not match the gap character.
UngappedCoords returns the positions in the sequence where the character does not match the gap character .
// Counts length of the rune slice instead of byte length of the string // Range over the slice of codons // If the codon does not match the gapChar string, then it is not a gap // Adds its position to the set map. // Range of set. Since this is a map, order is scrambled.