Sha256: 16bab77c8af7d89b7d7dae1b4bac1b5f22b601b52f445e32e17dae497717f147
Contents?: true
Size: 717 Bytes
Versions: 138
Compression:
Stored size: 717 Bytes
Contents
using System; using System.Collections.Generic; public class NucleotideCount { public IDictionary<char, int> NucleotideCounts { get; private set; } public NucleotideCount(string sequence) { InitializeNucleotideCounts(sequence); } private void InitializeNucleotideCounts(string sequence) { NucleotideCounts = new Dictionary<char, int> { { 'A', 0 }, { 'T', 0 }, { 'C', 0 }, { 'G', 0 } }; try { foreach (var s in sequence) NucleotideCounts[s] += 1; } catch (KeyNotFoundException) { throw new InvalidNucleotideException(); } } } public class InvalidNucleotideException : Exception { }
Version data entries
138 entries across 138 versions & 1 rubygems