BSD-3-Clause licensed by Pavel Yakovlev
Maintained by [email protected]
This version can be pinned in stack with:uniprot-kb-0.1.2.0@sha256:315ef18090167d94fb96f5103e9fe8bbf0d23c5970bd8c61b14b730a846e98bc,1623

Module documentation for 0.1.2.0

Depends on 3 packages(full list with versions):

uniprot-kb

Travis hackage hackage-deps

A well-typed UniProt file format parser.

Documentation

To build Haddock documentation run:

$ stack haddock

Usage example

You can use this simple code to parse any UniProt file:

import           Bio.Uniprot
import           Data.Attoparsec.Text (parseOnly)
import           Data.Text            (Text)
import qualified Data.Text.IO         as TIO
import           Text.Pretty.Simple   (pPrint)

main :: IO ()
main = do
    uniprot <- TIO.getContents
    case parseOnly parseRecord uniprot of
      Left err  -> putStrLn "Error on parse"
      Right obj -> pPrint obj

So you can parse any stdin Text of UniProt by using parseRecord function. The result will be presented by a Record datatype:

data Record = Record
  { id   :: ID
  , ac   :: AC
  , dt   :: DT
  , de   :: DE
  , gn   :: [GN]
  , os   :: OS
  , og   :: Maybe OG
  , oc   :: OC
  , ox   :: Maybe OX
  , oh   :: [OH]
  , refs :: [Reference]
  , cc   :: [CC]
  , dr   :: [DR]
  , pe   :: PE
  , kw   :: KW
  , ft   :: [FT]
  , sq   :: SQ
  } deriving (Show, Eq, Ord)

You can run this to test the implementation:

stack runhaskell uniprot.hs < example/LOLA2_DROME.dat

Changes

Changelog for uniprot-kb

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

0.1.2.0

  • Every record in UniProt-KB can be parsed.
  • Any capital english letter can be an amino acid.
  • Schema was changed a little.
  • Multiple fixes on specification bugs.
  • Evidence is not parsed any more as it’s breaks specification in lots of ways.

0.1.1.2

  • Empty FT description bugfix

0.1.1.1

  • Generic deriving for all types

0.1.1.0

  • Back compability lost for SQ section
  • No more DuplicateRecordFields, so it can be built by 7.x
  • Includes and Contains sections of DE tested

0.1.0.1

  • Small fixes in description fields read
  • Documentation fixes
  • Usage example in README

0.1.0.0

  • Any UniProt-KB file can be parsed