Created
March 13, 2015 02:18
-
-
Save amonshiz/da2e34e9c4618d99aecd 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 qualified Bioinformatics.Protein as P | |
import qualified Data.Map as M | |
import Control.Applicative | |
calculateProteinMass :: String -> Maybe Double | |
calculateProteinMass aas = sum <$> (sequence $ map (flip M.lookup P.monoisotopicMasses . P.charToAminoAcid) aas) | |
main = do | |
aas <- getLine | |
-- putStrLn . show . calculateProteinMass $ map P.charToAminoAcid aas | |
putStrLn . show $ calculateProteinMass aas |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment