Sha256: 54cdcbde89078a0aef6295160f87c49bfd268c7c5b606dc6d399d7255c3c2509
Contents?: true
Size: 604 Bytes
Versions: 123
Compression:
Stored size: 604 Bytes
Contents
module NucleotideCount let private validNucleotides = ['A'; 'T'; 'C'; 'G'] let private isValid nucleotide = List.contains nucleotide validNucleotides let count (nucleotide:char) (strand:string) = match isValid nucleotide with | true -> Seq.fold (fun acc elem -> if elem = nucleotide then acc + 1 else acc) 0 strand | false -> failwith "Invalid nucleotide" let nucleotideCounts strand = if String.forall isValid strand then List.map (fun nucleotide -> (nucleotide, count nucleotide strand)) validNucleotides |> Map.ofSeq |> Some else None
Version data entries
123 entries across 123 versions & 1 rubygems