Sha256: 5fcde682d510039253eb87c76f37f2a12287736b3667c102e1a9fef505f4e260
Contents?: true
Size: 440 Bytes
Versions: 376
Compression:
Stored size: 440 Bytes
Contents
import sequtils import tables proc count*(nt: char, dna: string): int = let nts = toSeq(dna.items) var nt_count = 0 for n in nts: if n == nt: nt_count += 1 nt_count proc count_dna*(dna: string): CountTable[char] = var counts = initCountTable[char]() for nt in toSeq(dna.items): if nt in ['A', 'C', 'G', 'T']: counts.inc(nt) else: raise newException(ValueError, "Invalid nucleotide") counts
Version data entries
376 entries across 376 versions & 1 rubygems