packages feed

ViennaRNAParser 1.3.2 → 1.3.3

raw patch · 4 files changed

+94/−14 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Bio.RNAfoldData: RNAfoldMEA :: String -> String -> String -> Double -> String -> Double -> String -> Double -> Double -> String -> Double -> Double -> Double -> Double -> RNAfoldMEA
+ Bio.RNAfoldData: [centroidDistance] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [centroidFoldingEnergy] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [centroidStructure] :: RNAfoldMEA -> String
+ Bio.RNAfoldData: [coarseFoldingEnergy] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [coarseStructure] :: RNAfoldMEA -> String
+ Bio.RNAfoldData: [ensembleDiversity] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [meaDistance] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [meaFoldSequence] :: RNAfoldMEA -> String
+ Bio.RNAfoldData: [meaFoldingEnergy] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [meaSequenceIdentifier] :: RNAfoldMEA -> String
+ Bio.RNAfoldData: [meaStructure] :: RNAfoldMEA -> String
+ Bio.RNAfoldData: [mfeFreq] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: [mfeStructure] :: RNAfoldMEA -> String
+ Bio.RNAfoldData: [mfefoldingEnergy] :: RNAfoldMEA -> Double
+ Bio.RNAfoldData: data RNAfoldMEA
+ Bio.RNAfoldData: instance GHC.Classes.Eq Bio.RNAfoldData.RNAfoldMEA
+ Bio.RNAfoldData: instance GHC.Show.Show Bio.RNAfoldData.RNAfoldMEA
+ Bio.RNAfoldParser: parseRNAMEAfold :: [Char] -> Either ParseError RNAfoldMEA
+ Bio.RNAfoldParser: readRNAMEAfold :: String -> IO (Either ParseError RNAfoldMEA)
+ Bio.RNAfoldParser: systemRNAfoldOptions :: String -> String -> String -> IO ExitCode

Files

ViennaRNAParser.cabal view
@@ -1,18 +1,12 @@ name:                ViennaRNAParser--- The package version.  See the Haskell package versioning policy (PVP) --- for standards guiding when and how versions should be incremented.--- http://www.haskell.org/haskellwiki/Package_versioning_policy--- PVP summary:      +-+------- breaking API changes---                   | | +----- non-breaking API additions---                   | | | +--- code changes with no API change-version:             1.3.2+version:             1.3.3 synopsis:            Libary for parsing ViennaRNA package output description:         Currently contains parsers and datatypes for: RNAalifold, RNAcode, RNAdistance, RNAcofold, RNAfold, RNAplex, RNAup, RNAz. 		     . 		     For more information on the ViennaRNA package refer to <http://www.tbi.univie.ac.at/RNA/>. 		     . 		     The libary is tested with Version 2.3.2 of the ViennaRNA package.                      -license:             GPL+license:             GPL-3 license-file:        LICENSE author:              Florian Eggenhofer maintainer:          florian.eggenhofer@univie.ac.at@@ -30,8 +24,8 @@  source-repository this   type:     git-  location: https://github.com/eggzilla/ViennaRNAParser/tree/1.3.2-  tag:      1.3.2+  location: https://github.com/eggzilla/ViennaRNAParser/tree/1.3.3+  tag:      1.3.3  library   -- Modules exported by the library.@@ -55,7 +49,7 @@                      Bio.RNAupParser    -- compiler-options:-  ghc-options:         -Wall -O2 -fno-warn-unused-do-bind+  ghc-options:         -Wall -fno-warn-unused-do-bind    -- Other library packages from which modules are imported.   build-depends:       base >=4.5 && <5, parsec>=3.1.9, process, transformers, ParsecTools
changelog view
@@ -1,4 +1,6 @@ -*-change-log-*-+1.3.3 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 18. October 2017+        * Added parsing for RNA maximum expected accuracy fold output 1.3.2 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 20. January 2017         * Fix for RNAalifold systemcall function 1.3.1 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 23. October 2016
src/Bio/RNAfoldData.hs view
@@ -11,3 +11,22 @@     foldingEnergy :: Double   }   deriving (Show, Eq)++data RNAfoldMEA = RNAfoldMEA+  { +    meaSequenceIdentifier :: String,+    meaFoldSequence :: String,+    mfeStructure :: String,+    mfefoldingEnergy :: Double,+    coarseStructure :: String,+    coarseFoldingEnergy :: Double,+    centroidStructure :: String,+    centroidFoldingEnergy :: Double,+    centroidDistance :: Double,+    meaStructure :: String,+    meaFoldingEnergy :: Double,+    meaDistance :: Double,+    mfeFreq :: Double,+    ensembleDiversity :: Double+  }+  deriving (Show, Eq)
src/Bio/RNAfoldParser.hs view
@@ -4,7 +4,10 @@ module Bio.RNAfoldParser (                        systemRNAfold,                        parseRNAfold,-                       readRNAfold,                                   +                       readRNAfold,+                       systemRNAfoldOptions,+                       parseRNAMEAfold,+                       readRNAMEAfold,                        module Bio.RNAfoldData                       ) where @@ -19,7 +22,11 @@ systemRNAfold :: String -> String -> IO ExitCode systemRNAfold inputFilePath outputFilePath = system ("RNAfold --noPS  <" ++ inputFilePath  ++ " >" ++ outputFilePath) --- | Parse the consenus of RNAz results         +-- | Run external RNAfold command and read the output into the corresponding datatype+systemRNAfoldOptions :: String -> String -> String -> IO ExitCode+systemRNAfoldOptions foldoptions inputFilePath outputFilePath = system ("RNAfold --noPS " ++ foldoptions ++  "  <" ++ inputFilePath  ++ " >" ++ outputFilePath)++-- | Parse the RNAfold results genParserRNAfold :: GenParser Char st RNAfold genParserRNAfold = do   string (">") @@ -32,7 +39,7 @@   string ("(")   _foldingEnergy <- many1 (noneOf ")")   string (")")-  return $ RNAfold _sequenceIdentifier _sequence _secondaryStructure (readDouble _foldingEnergy)+  return $ RNAfold _sequenceIdentifier _sequence _secondaryStructure (readDouble _foldingEnergy)    -- | parse RNAfold output from input string parseRNAfold :: [Char] -> Either ParseError RNAfold@@ -42,4 +49,62 @@ readRNAfold :: String -> IO (Either ParseError RNAfold)                   readRNAfold filePath = do   parsedFile <- parseFromFile genParserRNAfold filePath+  CE.evaluate parsedFile+++-- | Parse the RNAfold maximum expected accuracy results+genParserRNAMEAfold :: GenParser Char st RNAfoldMEA+genParserRNAMEAfold = do+  string (">") +  _sequenceIdentifier <- many1 (noneOf "\n")                +  newline+  _sequence <- many1 (noneOf "\n")                +  newline+  --MFE+  _mfestructure <- many1 (oneOf "&().,")+  space+  string ("(")+  _mfefoldingEnergy <- many1 (noneOf ")")+  string (")")+  --coarse representation+  newline +  _coarsestructure <- many1 (oneOf "&().,")+  space+  string ("[")+  _coarsefoldingEnergy <- many1 (noneOf "]")+  string ("]")+  --centroid structure+  newline +  _centroidstructure <- many1 (oneOf "&().,")+  space+  string ("{")+  _centroidfoldingEnergy <- many1 (noneOf " ")+  string (" ")+  _centroiddistance <- many1 (noneOf "}")+  string ("}")+  --MEA+  newline+  _meastructure <- many1 (oneOf "&().,")+  space+  string ("{")+  _meafoldingenergy <- many1 (noneOf " ")+  string (" ")+  _meadistance <- many1 (noneOf "}")+  string ("}")+  newline+  string " frequency of mfe structure in ensemble "+  _mfefreq <- many1 (noneOf ";")+  string "; ensemble diversity "+  _ensemblediversity <- many1 (noneOf " ")+  string " "+  return $ RNAfoldMEA _sequenceIdentifier _sequence _mfestructure (readDouble _mfefoldingEnergy) _coarsestructure (readDouble _coarsefoldingEnergy) _centroidstructure (readDouble _centroidfoldingEnergy) (readDouble _centroiddistance) _meastructure (readDouble _meafoldingenergy) (readDouble _meadistance) (readDouble _mfefreq) (readDouble _ensemblediversity)++-- | parse RNAfold output from input string+parseRNAMEAfold :: [Char] -> Either ParseError RNAfoldMEA+parseRNAMEAfold input = parse genParserRNAMEAfold "genParseRNAfold" input++-- | parse RNAfold output from input filePath                      +readRNAMEAfold :: String -> IO (Either ParseError RNAfoldMEA)                  +readRNAMEAfold filePath = do+  parsedFile <- parseFromFile genParserRNAMEAfold filePath   CE.evaluate parsedFile