Created
June 7, 2013 01:48
-
-
Save jbtule/5726553 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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