Skip to content

Instantly share code, notes, and snippets.

@jbtule
Created June 7, 2013 01:48
Show Gist options
  • Save jbtule/5726553 to your computer and use it in GitHub Desktop.
Save jbtule/5726553 to your computer and use it in GitHub Desktop.
open System.Linq
[<EntryPoint>]
let main argv =
let counter = List.fold (fun (a,c,g,t) x -> match x with
| 'A' -> (a+1, c, g, t )
| 'C' -> (a, c+1, g, t )
| 'G' -> (a, c, g+1, t )
| 'T' -> (a, c, g, t+1)
| ___ -> failwith "unknown nucleotide") (0,0,0,0)
let atot, ctot, gtot, ttot = counter [for c in argv.First().ToUpper() -> c]
printfn "%d %d %d %d" atot ctot gtot ttot
0 // return an integer exit code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment