Created
March 10, 2015 04:37
-
-
Save amonshiz/120713dd82e2c2283635 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 | |
calculateProteinMass :: P.Protein -> Double | |
calculateProteinMass ps = | |
let masses = map getValue ps | |
getValue aa = maybe 0.0 id (M.lookup aa P.monoisotopicMasses) | |
in sum masses | |
main = do | |
aas <- getLine | |
putStrLn . show . calculateProteinMass $ map P.charToAminoAcid aas |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment