Skip to content

Commit

Permalink
Version 0.1.3.19. Exports and instances for Biosset. (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
vks4git authored Apr 30, 2021
1 parent dc5473b commit 073cdc9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

## [0.1.3.19] - 2021-04-30
### Changed
- Exports and instances for Biosset.

## [0.1.3.18] - 2021-03-09
### Fixed
- Lowercase insertion code parsing in PDB.
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cobot-io
version: 0.1.3.18
version: 0.1.3.19
github: "biocad/cobot-io"
license: BSD3
category: Bio
Expand Down
2 changes: 2 additions & 0 deletions src/Bio/FASTA.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Bio.FASTA
, toFile
, fastaP
, fastaPGeneric
, fastaLine
, modificationP
) where

import Control.Monad.IO.Class (MonadIO, liftIO)
Expand Down
8 changes: 5 additions & 3 deletions src/Bio/FASTA/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
module Bio.FASTA.Parser
( fastaP
, fastaPGeneric
, fastaLine
, modificationP
) where

import Bio.FASTA.Type (Fasta, FastaItem (..), ModItem (..), Modification (..),
Expand Down Expand Up @@ -37,10 +39,10 @@ seqName :: Parser Text
seqName = strip <$> (char '>' *> tabs *> takeWhile (`notElem` ['\n', '\r']) <* tabs <* eol)

fastaSeq :: ParsableFastaToken a => (Char -> Bool) -> Parser (BareSequence a)
fastaSeq predicate = bareSequence . mconcat <$> many' (line predicate)
fastaSeq predicate = bareSequence . mconcat <$> many' (fastaLine predicate)

line :: ParsableFastaToken a => (Char -> Bool) -> Parser [a]
line predicate = concat <$> many1' (many1' (parseToken predicate) <* many' (char ' ')) <* eol
fastaLine :: ParsableFastaToken a => (Char -> Bool) -> Parser [a]
fastaLine predicate = concat <$> many1' (many1' (parseToken predicate) <* many' (char ' ')) <* eol

eol :: Parser ()
eol = tabs *> choice [slashN, endOfInput]
Expand Down
5 changes: 3 additions & 2 deletions src/Bio/FASTA/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Bio.FASTA.Type
import Bio.Sequence (BareSequence)
import Data.Attoparsec.Text (Parser)
import Data.Text (Text)
import GHC.Generics (Generic)

-- | Type alias for FASTA file.
-- satisfies the following format : >(\s|\t)*[^\n\r]+(\s|\t)*(\n|\r)*((\w|\s)(\n|\r)*)*
Expand All @@ -33,7 +34,7 @@ class ParsableFastaToken a where
data ModItem
= Mod Modification
| Letter Char
deriving (Eq, Show)
deriving (Eq, Show, Generic)

data Modification
= Mod_A_Star
Expand Down Expand Up @@ -124,7 +125,7 @@ data Modification
| Mod_TTC
| Mod_TTT
| Unknown String
deriving (Eq, Show)
deriving (Eq, Show, Ord, Generic)

modificationToString :: Modification -> String
modificationToString Mod_A_Star = "[A*]"
Expand Down

0 comments on commit 073cdc9

Please sign in to comment.