packages feed

fasta 0.5.4.0 → 0.6.0.0

raw patch · 3 files changed

+1/−63 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Data.Fasta.Text.Lazy.Parse: pipesFasta :: MonadIO m => Handle -> Pipe Text FastaSequence m ()
- Data.Fasta.Text.Parse: pipesFasta :: MonadIO m => Handle -> Pipe Text FastaSequence m ()

Files

fasta.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             0.5.4.0+version:             0.6.0.0  -- A short (one-line) description of the package. synopsis:            A simple, mindless parser for fasta files.
src/Data/Fasta/Text/Lazy/Parse.hs view
@@ -10,7 +10,6 @@  module Data.Fasta.Text.Lazy.Parse ( parseFasta                                   , parseCLIPFasta-                                  , pipesFasta                                   , removeNs                                   , removeN                                   , removeCLIPNs ) where@@ -22,11 +21,7 @@ import Text.Parsec.Text.Lazy import qualified Data.Map.Strict as Map import qualified Data.Text.Lazy as T-import qualified System.IO as IO --- Cabal-import Pipes- -- Local import Data.Fasta.Text.Lazy.Types @@ -85,32 +80,6 @@   where     eToV (Right x) = x     eToV (Left x)  = error ("Unable to parse fasta file\n" ++ show x)---- | Parse a standard fasta file into lazy text sequences for pipes. This is--- the highly recommeded way of parsing, as it is computationally fast and--- uses constant file memory-pipesFasta :: (MonadIO m) => IO.Handle -> Pipe T.Text FastaSequence m ()-pipesFasta h = do-    first <- await-    getRest first ""-  where-    getRest x !acc = do-        eof <- liftIO $ IO.hIsEOF h-        if eof-            then yield FastaSequence { fastaHeader = T.tail x-                                     , fastaSeq    = T.filter-                                                     (`notElem` ("\n\r " :: String))-                                                     acc }-            else do-                y <- await-                if T.take 1 y == ">"-                    then do-                        yield FastaSequence { fastaHeader = T.tail x-                                            , fastaSeq    = T.filter-                                                            (`notElem` ("\n\r " :: String))-                                                            acc }-                        getRest y ""-                    else getRest x (acc `T.append` y)  -- | Remove Ns from a collection of sequences removeNs :: [FastaSequence] -> [FastaSequence]
src/Data/Fasta/Text/Parse.hs view
@@ -10,7 +10,6 @@  module Data.Fasta.Text.Parse ( parseFasta                              , parseCLIPFasta-                             , pipesFasta                              , removeNs                              , removeN                              , removeCLIPNs ) where@@ -22,11 +21,7 @@ import Text.Parsec.Text import qualified Data.Map.Strict as Map import qualified Data.Text as T-import qualified System.IO as IO --- Cabal-import Pipes- -- Local import Data.Fasta.Text.Types @@ -86,32 +81,6 @@   where     eToV (Right x) = x     eToV (Left x)  = error ("Unable to parse fasta file\n" ++ show x)---- | Parse a standard fasta file into strict text sequences for pipes. This is--- the highly recommeded way of parsing, as it is computationally fast and--- uses constant file memory-pipesFasta :: (MonadIO m) => IO.Handle -> Pipe T.Text FastaSequence m ()-pipesFasta h = do-    first <- await-    getRest first ""-  where-    getRest x !acc = do-        eof <- liftIO $ IO.hIsEOF h-        if eof-            then yield FastaSequence { fastaHeader = T.tail x-                                     , fastaSeq    = T.filter-                                                     (`notElem` ("\n\r " :: String))-                                                     acc }-            else do-                y <- await-                if T.take 1 y == ">"-                    then do-                        yield FastaSequence { fastaHeader = T.tail x-                                            , fastaSeq    = T.filter-                                                            (`notElem` ("\n\r " :: String))-                                                            acc }-                        getRest y ""-                    else getRest x (acc `T.append` y)  -- | Remove Ns from a collection of sequences removeNs :: [FastaSequence] -> [FastaSequence]