mirror of
https://github.com/correl/elm.git
synced 2024-11-16 03:00:08 +00:00
18 lines
402 B
Text
18 lines
402 B
Text
module NucleotideCount (..) where
|
|
|
|
import String
|
|
import List
|
|
|
|
|
|
nucleotideCounts : String -> List ( Char, Int )
|
|
nucleotideCounts sequence =
|
|
[ (getCount 'A' sequence)
|
|
, (getCount 'T' sequence)
|
|
, (getCount 'C' sequence)
|
|
, (getCount 'G' sequence)
|
|
]
|
|
|
|
|
|
getCount : Char -> String -> ( Char, Int )
|
|
getCount base sequence =
|
|
( base, (List.length (String.split (String.fromChar base) sequence)) - 1 )
|