Created
January 10, 2015 16:38
-
-
Save amonshiz/28f335f3d793ebb911c0 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
| import Bioinformatics.DNANucleotide as D | |
| main = do | |
| substrand <- getLine | |
| putStrLn . concat . map show . reverse . map D.nucleotideComplement $ map D.charToDNANucleotide substrand |
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
| module Bioinformatics.DNANucleotide ( | |
| DNANucleotide (..), | |
| charToDNANucleotide, | |
| nucleotideComplement | |
| ) where | |
| import Data.Char | |
| import Data.List | |
| data DNANucleotide = A | C | G | T deriving(Show, Eq, Ord, Read) | |
| charToDNANucleotide :: Char -> DNANucleotide | |
| charToDNANucleotide c = read [toUpper c] :: DNANucleotide | |
| nucleotideComplement :: DNANucleotide -> DNANucleotide | |
| nucleotideComplement A = T | |
| nucleotideComplement T = A | |
| nucleotideComplement C = G | |
| nucleotideComplement G = C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment