cobot-io 0.1.2.4 → 0.1.2.5
raw patch · 5 files changed
+22/−12 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- cobot-io.cabal +2/−2
- src/Bio/FASTA/Parser.hs +9/−8
- src/Bio/FASTA/Type.hs +2/−1
- test/FASTASpec.hs +5/−1
ChangeLog.md view
@@ -2,6 +2,10 @@ ## [Unreleased] +## [0.1.2.5] - 2019-12-24+### Fixed+- Possibility to have spaces in Fasta sequences.+ ## [0.1.2.4] - 2019-12-23 ### Added - Preprocessing for pdb-files.
cobot-io.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1ecc108258e91fab1cf40b3e7a3dbb217465d2d0d4b32b76560469f2cf1ca543+-- hash: 0e861a80d499c39e6ac8b1c1cb2b2fbcb63c09cd506f31744cbba112b69d71c5 name: cobot-io-version: 0.1.2.4+version: 0.1.2.5 synopsis: Biological data file formats and IO description: Please see the README on GitHub at <https://github.com/less-wrong/cobot-io#readme> category: Bio
src/Bio/FASTA/Parser.hs view
@@ -2,12 +2,13 @@ ( fastaP ) where -import Bio.FASTA.Type (Fasta, FastaItem(..))-import Bio.Sequence (BareSequence, bareSequence)-import Data.Attoparsec.Text (Parser, many', many1', char, endOfLine, letter,- takeWhile, choice, endOfInput)-import Data.Text (Text, strip)-import Prelude hiding (takeWhile)+import Bio.FASTA.Type (Fasta, FastaItem (..))+import Bio.Sequence (BareSequence, bareSequence)+import Data.Attoparsec.Text (Parser, char, choice, endOfInput,+ endOfLine, letter, many', many1',+ takeWhile)+import Data.Text (Text, strip)+import Prelude hiding (takeWhile) -- | Parser of .fasta file. --@@ -23,8 +24,8 @@ fastaSeq :: Parser (BareSequence Char) fastaSeq = bareSequence . mconcat <$> many' line -line :: Parser (String)-line = many1' letter <* eol+line :: Parser String+line = concat <$> many1' (many1' letter <* many' (char ' ')) <* eol eol :: Parser () eol = tabs *> choice [slashN, endOfInput]
src/Bio/FASTA/Type.hs view
@@ -7,7 +7,8 @@ import Data.Text (Text) -- | Type alias for FASTA file.--- satisfies the following format : >(\s|\t)*[^\n\r]+(\s|\t)*(\n|\r)*(\w(\n|\r)*)*+-- satisfies the following format : >(\s|\t)*[^\n\r]+(\s|\t)*(\n|\r)*((\w|\s)(\n|\r)*)*+-- type Fasta a = [FastaItem a] -- | One record in FASTA file.
test/FASTASpec.hs view
@@ -10,7 +10,11 @@ import Test.Hspec correctFasta :: Fasta Char-correctFasta = [FastaItem "3HMX:A|PDBID|CHAIN|SEQUENCE" (bareSequence "IWELKKDVYVVELDWYPDAPGEMVVLTCDTPEEDGITWTLDQSSEVLGSGKTLTIQVKEFGDAGQYTCHKGGEVLSHSLL"), FastaItem "7HMX:A|PDBID|CHAIN|SEQUENCE" (bareSequence "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVLGSGKTLTIQVKEFGDAGQYTCHKGGEVLSHSLL")]+correctFasta = [ FastaItem "3HMX:A|PDBID|CHAIN|SEQUENCE" (bareSequence "IWELKKDVYVVELDWYPDAPGEMVVLTCDTPEEDGITWTLDQSSEVLGSGKTLTIQVKEFGDAGQYTCHKGGEVLSHSLL")+ , FastaItem "7HMX:A|PDBID|CHAIN|SEQUENCE" (bareSequence "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVLGSGKTLTIQVKEFGDAGQYTCHKGGEVLSHSLL")+ , FastaItem "With_spaces" (bareSequence "MDFFDLDIEIKQERLPAECSLNSPLNYSLSAQLTDRMTPRTENVRRQRERMDFFDLDIEIKQERLPAECSLNSPLNYSLSAQLTDRMTPRTENVRRQRERMDFFDLDIEIKQERLPAECSLNSPLNYSLSAQLTDRMTPRTENVRRQRER")+ , FastaItem "Empty_ha_ha_ha" (bareSequence "")+ ] fastaSpec :: Spec fastaSpec = describe "Fasta file parser." $ do