mirror of
https://github.com/correl/elm.git
synced 2024-12-23 03:00:08 +00:00
20 lines
350 B
Text
20 lines
350 B
Text
module NucleotideCount (..) where
|
|
|
|
import String
|
|
|
|
|
|
version =
|
|
2
|
|
|
|
|
|
nucleotideCounts : String -> { a : Int, t : Int, c : Int, g : Int }
|
|
nucleotideCounts sequence =
|
|
let
|
|
getCount n =
|
|
String.filter (\c -> c == n) sequence |> String.length
|
|
in
|
|
{ a = getCount 'A'
|
|
, t = getCount 'T'
|
|
, c = getCount 'C'
|
|
, g = getCount 'G'
|
|
}
|