ViennaRNAParser 1.3.0 → 1.3.1
raw patch · 4 files changed
+54/−32 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Bio.RNAcodeData: [length] :: RNAcodeHit -> Int
+ Bio.RNAcodeData: [hitLength] :: RNAcodeHit -> Int
+ Bio.RNAcodeData: [strand] :: RNAcodeHit -> Char
- Bio.RNAcodeData: RNAcodeHit :: Int -> Double -> Int -> Int -> Int -> String -> Int -> Int -> Double -> Double -> RNAcodeHit
+ Bio.RNAcodeData: RNAcodeHit :: Int -> Char -> Int -> Int -> Int -> Int -> String -> Int -> Int -> Double -> Double -> RNAcodeHit
- Bio.RNAcodeData: [frame] :: RNAcodeHit -> Double
+ Bio.RNAcodeData: [frame] :: RNAcodeHit -> Int
Files
- ViennaRNAParser.cabal +3/−3
- changelog +3/−0
- src/Bio/RNAcodeData.hs +3/−2
- src/Bio/RNAcodeParser.hs +45/−27
ViennaRNAParser.cabal view
@@ -5,7 +5,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 1.3.0+version: 1.3.1 synopsis: Libary for parsing ViennaRNA package output description: Currently contains parsers and datatypes for: RNAalifold, RNAcode, RNAdistance, RNAcofold, RNAfold, RNAplex, RNAup, RNAz. .@@ -30,8 +30,8 @@ source-repository this type: git- location: https://github.com/eggzilla/ViennaRNAParser/tree/1.3.0- tag: 1.3.0+ location: https://github.com/eggzilla/ViennaRNAParser/tree/1.3.1+ tag: 1.3.1 library -- Modules exported by the library.
changelog view
@@ -1,4 +1,7 @@ -*-change-log-*-+1.3.1 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 23. October 2016+ * Improvements to RNAcode parser,+ * Improvements to travis testing 1.3.0 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 6. September 2016 * Added support for new prefilter fields in RNAplex output 1.2.8 Florian Eggenhofer <florian.eggenhofer@univie.ac.at> 11. February 2016
src/Bio/RNAcodeData.hs view
@@ -22,8 +22,9 @@ data RNAcodeHit = RNAcodeHit { hss :: Int,- frame :: Double,- length :: Int,+ strand :: Char,+ frame :: Int,+ hitLength :: Int, from :: Int, to :: Int, name :: String,
src/Bio/RNAcodeParser.hs view
@@ -19,6 +19,7 @@ import qualified Control.Exception.Base as CE import Text.Parsec.Language (haskell) import Control.Applicative ((<*>),(<$>),(<$),pure)+import Text.Parsec.Numbers -- | Run external RNAcode command and read the output into the corresponding datatype systemRNAcode :: String -> String -> String -> IO ExitCode@@ -33,21 +34,29 @@ -- | Parse the input as RNAcodeHit genParseRNAcodeTabularHit :: GenParser Char st RNAcodeHit genParseRNAcodeTabularHit = do- _hss <- natural haskell- _frame <- integer haskell- _length <- natural haskell- _from <- natural haskell- _to <- natural haskell- _name <- identifier haskell- --_name <- identifier haskell+ _hss <- parseIntegral+ tab+ _strand <- oneOf "+-"+ tab+ _frame <- parseIntegral+ tab + _length <- parseIntegral+ tab+ _from <- parseIntegral+ tab + _to <-parseIntegral+ tab _name <- many1 (oneOf "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890_-")- string ("\t")- _start <- natural haskell- _end <- natural haskell- _score <- many1 (oneOf "1234567890e.-+")- many space- _pvalue <- float haskell- return $ RNAcodeHit (fromInteger _hss) (fromInteger _frame) (fromInteger _length) (fromInteger _from) (fromInteger _to) _name (fromInteger _start) (fromInteger _end) (read _score ::Double) _pvalue + tab+ _start <- parseIntegral+ tab + _end <- parseIntegral+ tab + _score <- parseFloat+ tab + _pvalue <- parseFloat+ newline+ return $ RNAcodeHit _hss _strand _frame _length _from _to _name _start _end _score _pvalue -- | Parse the input as RNAcode datatype@@ -82,20 +91,29 @@ genParseRNAcodeHit :: GenParser Char st RNAcodeHit genParseRNAcodeHit = do many (char ' ')- _hss <- natural haskell- _frame <- integer haskell- _length <- natural haskell- _from <- natural haskell- _to <- natural haskell- --_name <- identifier haskell+ _hss <- parseIntegral+ tab+ _strand <- oneOf "+-" + tab+ _frame <- parseIntegral+ tab+ _length <- parseIntegral+ tab+ _from <- parseIntegral+ tab+ _to <- parseIntegral+ tab _name <- many1 (oneOf "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890_-")- string ("\t")- _start <- natural haskell- _end <- natural haskell- _score <- float haskell- _pvalue <- many1 (try (choice [digit,char '.']))+ tab+ _start <- parseIntegral+ tab+ _end <- parseIntegral+ tab + _score <- parseFloat+ tab + _pvalue <- parseFloat newline- return $ RNAcodeHit (fromInteger _hss) (fromInteger _frame) (fromInteger _length) (fromInteger _from) (fromInteger _to) _name (fromInteger _start) (fromInteger _end) _score (read _pvalue :: Double)+ return $ RNAcodeHit _hss _strand _frame _length _from _to _name _start _end _score _pvalue -- | parse RNAcode from input string parseRNAcode :: String -> Either ParseError RNAcode@@ -109,7 +127,7 @@ -- | parse RNAcode from input string parseRNAcodeTabular :: String -> Either ParseError RNAcode-parseRNAcodeTabular = parse genParseRNAcodeTabular "parseRNAcode" +parseRNAcodeTabular = parse genParseRNAcodeTabular "parseRNAcodeTabular" -- | parse RNAcode from input filePath readRNAcodeTabular :: String -> IO (Either ParseError RNAcode)