class NucleotideCount {
static count(strand) {
def nucleotides = ['A': 0, 'C': 0, 'G': 0, 'T': 0].withDefault {throw new ArithmeticException()}
strand.each { nucleotides[it] += 1}
nucleotides
}
}
class NucleotideCount {
static count(strand) {
def nucleotides = ['A': 0, 'C': 0, 'G': 0, 'T': 0].withDefault {throw new ArithmeticException()}
strand.each { nucleotides[it] += 1}
nucleotides
}
}