packages feed

fasta 0.10.3.0 → 0.10.4.0

raw patch · 7 files changed

+84/−1 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Fasta.ByteString.Lazy.Utility: compl :: FastaSequence -> FastaSequence
+ Data.Fasta.ByteString.Lazy.Utility: revCompl :: FastaSequence -> FastaSequence
+ Data.Fasta.ByteString.Utility: compl :: FastaSequence -> FastaSequence
+ Data.Fasta.ByteString.Utility: revCompl :: FastaSequence -> FastaSequence
+ Data.Fasta.String.Utility: compl :: FastaSequence -> FastaSequence
+ Data.Fasta.String.Utility: revCompl :: FastaSequence -> FastaSequence
+ Data.Fasta.Text.Lazy.Utility: compl :: FastaSequence -> FastaSequence
+ Data.Fasta.Text.Lazy.Utility: revCompl :: FastaSequence -> FastaSequence
+ Data.Fasta.Text.Utility: compl :: FastaSequence -> FastaSequence
+ Data.Fasta.Text.Utility: revCompl :: FastaSequence -> FastaSequence
+ Data.Fasta.Utility: complRules :: Char -> Char

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.10.3.0+version:             0.10.4.0  -- A short (one-line) description of the package. synopsis:            A simple, mindless parser for fasta files.@@ -48,6 +48,7 @@ library   -- Modules exported by the library.   exposed-modules:    Data.Fasta.Category,+                      Data.Fasta.Utility,                       Data.Fasta.String,                       Data.Fasta.String.Types,                       Data.Fasta.String.Parse,
src/Data/Fasta/ByteString/Lazy/Utility.hs view
@@ -5,6 +5,8 @@ -}  module Data.Fasta.ByteString.Lazy.Utility ( getField+                                          , compl+                                          , revCompl                                           ) where  -- Built in@@ -14,8 +16,17 @@  -- Local import Data.Fasta.ByteString.Lazy.Types+import Data.Fasta.Utility  -- | Gets a 1 indexed field from the header of a fasta sequence using a certain -- delimiter. getField :: Int -> Char -> FastaSequence -> BL.ByteString getField field delim = (!! (field - 1)) . BL.split delim . fastaHeader++-- | Gets the complement of the sequence.+compl :: FastaSequence -> FastaSequence+compl fs = fs { fastaSeq = BL.map complRules . fastaSeq $ fs }++-- | Gets the reverse complement of the sequence.+revCompl :: FastaSequence -> FastaSequence+revCompl fs = fs { fastaSeq = BL.reverse . BL.map complRules . fastaSeq $ fs }
src/Data/Fasta/ByteString/Utility.hs view
@@ -5,6 +5,8 @@ -}  module Data.Fasta.ByteString.Utility ( getField+                                     , compl+                                     , revCompl                                      ) where  -- Built in@@ -14,8 +16,17 @@  -- Local import Data.Fasta.ByteString.Types+import Data.Fasta.Utility  -- | Gets a 1 indexed field from the header of a fasta sequence using a certain -- delimiter. getField :: Int -> Char -> FastaSequence -> B.ByteString getField field delim = (!! (field - 1)) . B.split delim . fastaHeader++-- | Gets the complement of the sequence.+compl :: FastaSequence -> FastaSequence+compl fs = fs { fastaSeq = B.map complRules . fastaSeq $ fs }++-- | Gets the reverse complement of the sequence.+revCompl :: FastaSequence -> FastaSequence+revCompl fs = fs { fastaSeq = B.reverse . B.map complRules . fastaSeq $ fs }
src/Data/Fasta/String/Utility.hs view
@@ -5,6 +5,8 @@ -}  module Data.Fasta.String.Utility ( getField+                                 , compl+                                 , revCompl                                  ) where  -- Built in@@ -14,8 +16,17 @@  -- Local import Data.Fasta.String.Types+import Data.Fasta.Utility  -- | Gets a 1 indexed field from the header of a fasta sequence using a certain -- delimiter. getField :: Int -> Char -> FastaSequence -> String getField field delim = (!! (field - 1)) . Split.splitWhen (== delim) . fastaHeader++-- | Gets the complement of the sequence.+compl :: FastaSequence -> FastaSequence+compl fs = fs { fastaSeq = fmap complRules . fastaSeq $ fs }++-- | Gets the reverse complement of the sequence.+revCompl :: FastaSequence -> FastaSequence+revCompl fs = fs { fastaSeq = reverse . fmap complRules . fastaSeq $ fs }
src/Data/Fasta/Text/Lazy/Utility.hs view
@@ -5,6 +5,8 @@ -}  module Data.Fasta.Text.Lazy.Utility ( getField+                                    , compl+                                    , revCompl                                     ) where  -- Built in@@ -14,8 +16,17 @@  -- Local import Data.Fasta.Text.Lazy.Types+import Data.Fasta.Utility  -- | Gets a 1 indexed field from the header of a fasta sequence using a certain -- delimiter. getField :: Int -> Char -> FastaSequence -> T.Text getField field delim = (!! (field - 1)) . T.split (== delim) . fastaHeader++-- | Gets the complement of the sequence.+compl :: FastaSequence -> FastaSequence+compl fs = fs { fastaSeq = T.map complRules . fastaSeq $ fs }++-- | Gets the reverse complement of the sequence.+revCompl :: FastaSequence -> FastaSequence+revCompl fs = fs { fastaSeq = T.reverse . T.map complRules . fastaSeq $ fs }
src/Data/Fasta/Text/Utility.hs view
@@ -5,6 +5,8 @@ -}  module Data.Fasta.Text.Utility ( getField+                               , compl+                               , revCompl                                ) where  -- Built in@@ -14,8 +16,17 @@  -- Local import Data.Fasta.Text.Types+import Data.Fasta.Utility  -- | Gets a 1 indexed field from the header of a fasta sequence using a certain -- delimiter. getField :: Int -> Char -> FastaSequence -> T.Text getField field delim = (!! (field - 1)) . T.split (== delim) . fastaHeader++-- | Gets the complement of the sequence.+compl :: FastaSequence -> FastaSequence+compl fs = fs { fastaSeq = T.map complRules . fastaSeq $ fs }++-- | Gets the reverse complement of the sequence.+revCompl :: FastaSequence -> FastaSequence+revCompl fs = fs { fastaSeq = T.reverse . T.map complRules . fastaSeq $ fs }
+ src/Data/Fasta/Utility.hs view
@@ -0,0 +1,27 @@+-- Utility Module+-- By Gregory W. Schwartz++{- | Collects all helpful random functions.+-}++module Data.Fasta.Utility ( complRules+                          ) where++-- Built in++-- Cabal++-- Local++-- | Defines the rules for complement. Unknown characters are left+-- untouched.+complRules :: Char -> Char+complRules 'A' = 'T'+complRules 'C' = 'G'+complRules 'G' = 'C'+complRules 'T' = 'A'+complRules 'a' = 't'+complRules 'c' = 'g'+complRules 'g' = 'c'+complRules 't' = 'a'+complRules x   = x