packages feed

Genbank 1.0.2 → 1.0.3

raw patch · 5 files changed

+19/−21 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Bio.GenbankData: Genbank :: ByteString -> Int -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> [Reference] -> ByteString -> [Feature] -> Maybe String -> SeqData -> Genbank
+ Bio.GenbankData: Genbank :: ByteString -> Int -> ByteString -> Maybe ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> ByteString -> Maybe ByteString -> ByteString -> ByteString -> ByteString -> [Reference] -> Maybe ByteString -> [Feature] -> Maybe String -> SeqData -> Genbank
- Bio.GenbankData: circular :: Genbank -> ByteString
+ Bio.GenbankData: circular :: Genbank -> Maybe ByteString
- Bio.GenbankData: comment :: Genbank -> ByteString
+ Bio.GenbankData: comment :: Genbank -> Maybe ByteString
- Bio.GenbankData: dblink :: Genbank -> ByteString
+ Bio.GenbankData: dblink :: Genbank -> Maybe ByteString

Files

Genbank.cabal view
@@ -5,7 +5,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             1.0.2+version:             1.0.3 synopsis:            Libary for processing the NCBI genbank format description:         Haskell cabal Genbank libary contains tools, parser and datastructures for the NCBI (National Center for Biotechnology Information) Genbank format.                      .@@ -42,8 +42,8 @@  source-repository this   type:     git-  location: https://github.com/eggzilla/Genbank/tree/1.0.2-  tag:      1.0.2+  location: https://github.com/eggzilla/Genbank/tree/1.0.3+  tag:      1.0.3  library   -- Modules exported by the library.@@ -51,10 +51,12 @@      -- Other library packages from which modules are imported.   build-depends:       base >=4.5 && <5, parsec, split, bytestring, biocore, biofasta-  +  ghc-options: -Wall -O2+   -- Directories containing source files.   hs-source-dirs:      src    executable GenbankTest   main-is:          GenbankTest.hs   build-depends:    base >= 4 && <= 5, cmdargs, Genbank+  ghc-options: -Wall -O2
GenbankTest.hs view
@@ -4,16 +4,13 @@ module Main where      import System.Environment (getArgs)-import System.IO-import Data.List import Bio.GenbankTools import Bio.GenbankParser  -import Data.Either-    ++main :: IO () main = do   args <- getArgs   let input_file = (head args)-  let output_file = (last args)                                          -- read Clustal outputfile   parsedinput <- readGenbank input_file
src/Bio/GenbankData.hs view
@@ -15,19 +15,19 @@     genbankLength :: Int,     -- DNA/RNA/Protein     moleculeType :: L.ByteString,-    circular :: L.ByteString,+    circular :: Maybe L.ByteString,     division :: L.ByteString,     creationDate:: L.ByteString,     definition :: L.ByteString,     accession :: L.ByteString,     version :: L.ByteString,     geneIdentifier :: L.ByteString,-    dblink :: L.ByteString,+    dblink :: Maybe L.ByteString,     keywords :: L.ByteString,     source :: L.ByteString,     organism :: L.ByteString,     references :: [Reference],-    comment :: L.ByteString,+    comment :: Maybe L.ByteString,     features :: [Feature],     contig :: Maybe String,     origin :: SeqData
src/Bio/GenbankParser.hs view
@@ -31,9 +31,9 @@   many1 space   moleculeType <- many1 (noneOf " ")   many1 space-  circular <- many1 (noneOf " ")-  many1 space-  division <- many1 (noneOf " ")+  circular <- optionMaybe (try (choice [string "linear",string "circular",string "LINEAR",string "CIRCULAR"]))+  many space+  division <-  many1 (noneOf " ")   many1 space   creationDate <- many1 (noneOf "\n")   newline@@ -45,12 +45,12 @@   many1 space   geneIdentifier <- many1 (noneOf "\n")   newline-  dblink <- genParserField "DBLINK" "KEYWORDS"+  dblink <- optionMaybe (try (genParserField "DBLINK" "KEYWORDS"))   keywords <- genParserField "KEYWORDS" "SOURCE"   source <- genParserField "SOURCE" "ORGANISM"   organism <- genParserField "ORGANISM" "REFERENCE"   references <- many1 genParserReference-  comment <- genParserField "COMMENT" "FEATURES"+  comment <- optionMaybe (try (genParserField "COMMENT" "FEATURES"))   string "FEATURES"   many1 space   string "Location/Qualifiers"@@ -63,7 +63,7 @@   origin <- many1 genParserOriginSequence   string "//"   newline-  return $ Genbank (L.pack locus) (readInt length) (L.pack moleculeType) (L.pack circular) (L.pack division) (L.pack creationDate) (L.pack definition) (L.pack accession) (L.pack version) (L.pack geneIdentifier) (L.pack dblink) (L.pack keywords) (L.pack source)  (L.pack organism) references (L.pack comment) features contig (origintoSeqData origin) +  return $ Genbank (L.pack locus) (readInt length) (L.pack moleculeType) (liftM L.pack circular) (L.pack division) (L.pack creationDate) (L.pack definition) (L.pack accession) (L.pack version) (L.pack geneIdentifier) (liftM L.pack dblink) (L.pack keywords) (L.pack source)  (L.pack organism) references (liftM L.pack comment) features contig (origintoSeqData origin)   -- | Parse a feature genParserFeature :: GenParser Char st Feature@@ -184,7 +184,7 @@   many1 space   authors <- choice [genParserField "AUTHORS" "TITLE", genParserField "CONSRTM" "TITLE"]   title <- genParserField "TITLE" "JOURNAL"-  journal <- choice [try (genParserField "JOURNAL" "REFERENCE"), genParserField "JOURNAL" "COMMENT"]+  journal <- choice [try (genParserField "JOURNAL" "REFERENCE"), try (genParserField "JOURNAL" "COMMENT"), try (genParserField "JOURNAL" "FEATURES")]   return $ Reference (readInt index) (liftM readInt baseFrom) (liftM readInt baseTo) authors title journal Nothing Nothing --pubmedId remark   parseFlag :: String -> GenParser Char st Char
src/Bio/GenbankTools.hs view
@@ -7,8 +7,6 @@                       ) where  import Bio.GenbankData-import Control.Monad-import Data.List import Data.Maybe import Bio.Core.Sequence import Data.Int@@ -51,6 +49,7 @@   | isNothing (setType seqCoordinates) = [extractSeqData genbankSeq (head (setCoordinates seqCoordinates))]   | fromJust (setType seqCoordinates) == "join" = extractJoinSeqData genbankSeq seqCoordinates   | fromJust (setType seqCoordinates) == "order" = extractOrderSeqData genbankSeq seqCoordinates+  | otherwise = []                                                     -- | Extract sequence data for CoordinateSets of type "join"  extractJoinSeqData :: SeqData -> CoordinateSet -> [SeqData]