packages feed

NGLess 1.4.1.1 → 1.4.2.0

raw patch · 5 files changed

+37/−20 lines, 5 files

Files

ChangeLog view
@@ -1,3 +1,6 @@+Version 1.4.2 2022-07-21 by luispedro+	* Fix bug with parsing GFF files+ Version 1.4.1 2022-06-03 by luispedro 	* Fix bug with split mapping 	* Fix packaging for hackage
NGLess.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           NGLess-version:        1.4.1.1+version:        1.4.2.0 synopsis:       NGLess implements ngless, a DSL for processing sequencing data description:    NGLess implements a domain-specific language for processing next generation data, particularly metagenomics. category:       Domain Specific Language
NGLess/Data/GFF.hs view
@@ -1,4 +1,4 @@-{- Copyright 2013-2019 NGLess Authors+{- Copyright 2013-2022 NGLess Authors  - License: MIT -} {-# LANGUAGE CPP #-} @@ -81,31 +81,32 @@ readGffLine line = case B8.split '\t' line of         [tk0,tk1,tk2,tk3,tk4,tk5,tk6,tk7,tk8] ->             GffLine-                tk0-                tk1-                tk2-                <$> intOrError tk3-                <*> intOrError tk4-                <*> score tk5+                tk0 -- seq id+                tk1 -- source+                tk2 -- type+                <$> intOrError "reading start" tk3 -- start+                <*> intOrError "reading end" tk4 -- end+                <*> score tk5 -- score                 <*> strandOrError tk6                 <*> phase tk7                 <*> pure (_parseGffAttributes tk8)         _ -> throwDataError ("unexpected line in GFF: " ++ show line)     where-        parseOrError :: (a -> Maybe b) -> a -> NGLess b-        parseOrError p s = case p s of+        parseOrError :: String -> (B.ByteString -> Maybe b) -> B.ByteString -> NGLess b+        parseOrError context p s = case p s of                     Just v -> return v-                    Nothing -> throwDataError $ "Could not parse GFF line: "++ show line-        intOrError :: B.ByteString -> NGLess Int-        intOrError = parseOrError (liftM fst . I.readDecimal)-        floatOrError = parseOrError (liftM fst . F.readDecimal)+                    Nothing -> throwDataError $ "Could not parse GFF line (" ++ context  ++ ", while parsing '" ++ B8.unpack s ++  "'): "++ show line+        intOrError :: String -> B.ByteString -> NGLess Int+        intOrError c = parseOrError c (liftM fst . I.readDecimal)+        floatOrError c = parseOrError c (liftM fst . (F.readSigned F.readDecimal))+         score :: B.ByteString -> NGLess (Maybe Float)         score "." = return Nothing-        score v = Just <$> floatOrError v+        score v = Just <$> floatOrError "reading score" v          phase :: B.ByteString -> NGLess Int         phase "." = return (-1)-        phase r = intOrError r+        phase r = intOrError "reading phase" r         strandOrError :: B.ByteString -> NGLess GffStrand         strandOrError s = case B8.uncons s of             Just (s',_) -> parseStrand s'
NGLess/Interpretation/Count.hs view
@@ -792,10 +792,23 @@         outputListLno' TraceOutput ["Loading GFF file '", gffFp, "'..."]         numCapabilities <- liftIO getNumCapabilities         let mapthreads = max 1 (numCapabilities - 1)+            annotateErrorReader :: (Int, V.Vector ByteLine) -> NGLess (V.Vector GffLine)+            annotateErrorReader (ch_ix, ells) =+                case V.mapM (readGffLine. unwrapByteLine) . V.filter (not . isComment) $ ells of+                    r@Right{} -> r+                    _ -> do+                        forM_ (zip [0..] $ V.toList ells) $ \(i, ell) ->+                            if isComment ell+                                then return ()+                                else case readGffLine (unwrapByteLine ell) of+                                        Right{} -> return ()+                                        Left (NGError errtype errmsg) -> Left (NGError errtype (errmsg ++ " (Line " ++ show (8192 * ch_ix + i + 1) ++ ")"))+                        throwShouldNotOccur "annotateErrorReader: this should never happen"         partials <- C.runConduit $                 conduitPossiblyCompressedFile gffFp                     .| linesVC 8192-                    .| CAlg.asyncMapEitherC mapthreads (V.mapM (readGffLine . unwrapByteLine) . V.filter (not . isComment))+                    .| CAlg.enumerateC+                    .| CAlg.asyncMapEitherC mapthreads annotateErrorReader                     .| sequenceSinks                         [CL.foldM (insertgV f sf) (GffLoadingState M.empty M.empty)                                     |  f <- optFeatures    opts
NGLess/Version.hs view
@@ -14,13 +14,13 @@ import Paths_NGLess (version)  versionStr :: String-versionStr = "1.4.1"+versionStr = "1.4.2"  versionStrLong :: String-versionStrLong = "1.4.1"+versionStrLong = "1.4.2"  dateStr :: String-dateStr = "June 3 2022"+dateStr = "July 21 2022"  embeddedStr :: String #ifdef NO_EMBED_SAMTOOLS_BWA