Created
March 30, 2016 14:15
-
-
Save jacqueline-homan/c1618551164f3395a858144b181d8224 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
open System.IO | |
let path = @"/home/jacque/Projects/F-sharp/Rosalind/Rosalind/rosalind_dna.txt" | |
let inputFromFile = File.ReadAllText(path) | |
let program (dna:string) = | |
inputFromFile | |
let countAs (inputFromFile:string) = | |
inputFromFile | |
|> Seq.filter (fun c -> c = 'A') | |
|> Seq.length | |
let countCs (inputFromFile:string) = | |
inputFromFile | |
|> Seq.filter (fun c -> c = 'C') | |
|> Seq.length | |
let countGs (inputFromFile:string) = | |
inputFromFile | |
|> Seq.filter (fun c -> c = 'G') | |
|> Seq.length | |
let countTs (inputFromFile:string) = | |
inputFromFile | |
|> Seq.filter (fun c -> c = 'T') | |
|> Seq.length | |
printfn "%s" inputFromFile | |
let countAnyLetter (inputFromFile:string) (letter:char) = | |
inputFromFile | |
|> Seq.filter (fun c -> c = letter) | |
|> Seq.length | |
let countChar (inputFromFile:string) (target:char) = | |
inputFromFile | |
|> Seq.filter (fun c -> c = target) | |
|> Seq.length | |
[<EntryPoint>] | |
let main argv = | |
printfn "Welcome to F# lessons!" | |
//printfn "PLEASE GIVE ME PATH TO THE FILE" | |
//let path = Console.ReadLine() | |
//let wait = Console.ReadLine () | |
0 // return an integer exit code | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment