fasta 0.5.1.5 → 0.5.2.0
raw patch · 4 files changed
+30/−10 lines, 4 filesdep ~parsecPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: parsec
API changes (from Hackage documentation)
Files
- fasta.cabal +2/−2
- src/Data/Fasta/String/Parse.hs +6/−0
- src/Data/Fasta/Text/Lazy/Parse.hs +11/−4
- src/Data/Fasta/Text/Parse.hs +11/−4
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.1.5+version: 0.5.2.0 -- A short (one-line) description of the package. synopsis: A simple, mindless parser for fasta files.@@ -65,7 +65,7 @@ -- Other library packages from which modules are imported. build-depends: base >=4.6 && <4.9,- parsec >=3.1.0 && <4.0,+ parsec >=3.1 && <4.0, text >=1.1.0 && <1.4, containers >= 0.5 && <0.6, split >= 0.2 && <0.3
src/Data/Fasta/String/Parse.hs view
@@ -82,6 +82,12 @@ where noN = map (\y -> if (y /= 'N' && y /= 'n') then y else '-') +-- | Remove Ns from a sequence+removeN :: FastaSequence -> FastaSequence+removeN x = x { fastaSeq = noN . fastaSeq $ x }+ where+ noN = map (\y -> if (y /= 'N' && y /= 'n') then y else '-')+ -- | Remove Ns from a collection of CLIP fasta sequences removeCLIPNs :: CloneMap -> CloneMap removeCLIPNs = M.fromList . map remove . M.toList
src/Data/Fasta/Text/Lazy/Parse.hs view
@@ -6,6 +6,7 @@ -} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE BangPatterns #-} module Data.Fasta.Text.Lazy.Parse ( parseFasta , parseCLIPFasta@@ -15,7 +16,7 @@ -- Built-in import Data.Char import Control.Monad (void)-import qualified Data.Map as M+import qualified Data.Map.Strict as M import Text.Parsec import Text.Parsec.Text.Lazy import qualified Data.Text.Lazy as T@@ -71,7 +72,7 @@ -- | Parse a CLIP fasta file into lazy text sequences parseCLIPFasta :: T.Text -> CloneMap parseCLIPFasta = M.fromList- . map (\(x, (y, z)) -> ((x, y), z))+ . map (\(!x, (!y, !z)) -> ((x, y), z)) . zip [0..] . eToV . parse fastaCLIPFile "error"@@ -85,10 +86,16 @@ where noN = T.map (\y -> if (y /= 'N' && y /= 'n') then y else '-') +-- | Remove Ns from a sequence+removeN :: FastaSequence -> FastaSequence+removeN x = x { fastaSeq = noN . fastaSeq $ x }+ where+ noN = T.map (\y -> if (y /= 'N' && y /= 'n') then y else '-')+ -- | Remove Ns from a collection of CLIP fasta sequences removeCLIPNs :: CloneMap -> CloneMap removeCLIPNs = M.fromList . map remove . M.toList where- remove ((x, y), z) = ((x, newSeq y), map newSeq z)- newSeq x = x { fastaSeq = noN . fastaSeq $ x }+ remove ((!x, !y), !z) = ((x, newSeq y), map newSeq z)+ newSeq !x = x { fastaSeq = noN . fastaSeq $ x } noN = T.map (\y -> if (y /= 'N' && y /= 'n') then y else '-')
src/Data/Fasta/Text/Parse.hs view
@@ -6,6 +6,7 @@ -} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE BangPatterns #-} module Data.Fasta.Text.Parse ( parseFasta , parseCLIPFasta@@ -14,7 +15,7 @@ -- Built-in import Data.Char-import qualified Data.Map as M+import qualified Data.Map.Strict as M import Control.Monad (void) import Text.Parsec import Text.Parsec.Text@@ -72,7 +73,7 @@ -- | Parse a CLIP fasta file into text sequences parseCLIPFasta :: T.Text -> CloneMap parseCLIPFasta = M.fromList- . map (\(x, (y, z)) -> ((x, y), z))+ . map (\(!x, (!y, !z)) -> ((x, y), z)) . zip [0..] . eToV . parse fastaCLIPFile "error"@@ -86,10 +87,16 @@ where noN = T.map (\y -> if (y /= 'N' && y /= 'n') then y else '-') +-- | Remove Ns from a sequence+removeN :: FastaSequence -> FastaSequence+removeN x = x { fastaSeq = noN . fastaSeq $ x }+ where+ noN = T.map (\y -> if (y /= 'N' && y /= 'n') then y else '-')+ -- | Remove Ns from a collection of CLIP fasta sequences removeCLIPNs :: CloneMap -> CloneMap removeCLIPNs = M.fromList . map remove . M.toList where- remove ((x, y), z) = ((x, newSeq y), map newSeq z)- newSeq x = x { fastaSeq = noN . fastaSeq $ x }+ remove ((!x, !y), !z) = ((x, newSeq y), map newSeq z)+ newSeq !x = x { fastaSeq = noN . fastaSeq $ x } noN = T.map (\y -> if (y /= 'N' && y /= 'n') then y else '-')