elynx-tree 0.7.0.1 → 0.7.1.0
raw patch · 5 files changed
+26/−8 lines, 5 filesdep −double-conversionPVP ok
version bump matches the API change (PVP)
Dependencies removed: double-conversion
API changes (from Hackage documentation)
Files
- ChangeLog.md +7/−0
- elynx-tree.cabal +1/−2
- src/ELynx/Tree/Import/Newick.hs +16/−1
- src/ELynx/Tree/Mrca.hs +1/−1
- src/ELynx/Tree/Name.hs +1/−4
ChangeLog.md view
@@ -5,6 +5,13 @@ ## Unreleased changes +## Version 0.7.1.0++- Be less strict with quoted identifiers/names in phylogenetic trees.+- Be less strict with FASTA identifiers.+- Update tooling (GHC 9.2.4).++ ## Version 0.7.0.1 - Random 1.2: Parallel functions now require an \`IOGenM\` random number
elynx-tree.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: elynx-tree-version: 0.7.0.1+version: 0.7.1.0 synopsis: Handle phylogenetic trees description: Examine, compare, and simulate phylogenetic trees in a reproducible way. Please see the README on GitHub at <https://github.com/dschrempf/elynx>.@@ -84,7 +84,6 @@ , containers , data-default-class , deepseq- , double-conversion , elynx-nexus , math-functions , parallel
src/ELynx/Tree/Import/Newick.hs view
@@ -145,8 +145,23 @@ -- A name can be any string of printable characters except blanks, colons, -- semicolons, parentheses, and square brackets (and commas).+nameNotQuoted :: Parser Name+nameNotQuoted = Name . BL.fromStrict <$> takeWhile nameChar <?> "nameNoQuotes"++noClosingQuote :: Char -> Bool+noClosingQuote c = c /= '\''++nameQuoted :: Parser Name+nameQuoted = (<?> "nameQuotes") $ do+ _ <- char '\''+ n <- Name . BL.fromStrict <$> takeWhile noClosingQuote <?> "nameQuoted"+ _ <- char '\''+ pure n++-- A name can be any string of printable characters except blanks, colons,+-- semicolons, parentheses, and square brackets (and commas). name :: Parser Name-name = Name . BL.fromStrict <$> takeWhile nameChar <?> "name"+name = nameQuoted <|> nameNotQuoted <?> "name" phylo :: Parser Phylo phylo = Phylo <$> optional branchLengthStandard <*> optional branchSupportStandard <?> "phylo"
src/ELynx/Tree/Mrca.hs view
@@ -104,7 +104,7 @@ [] -> Just $ Right $ S.singleton x (l : r : _) -> Just $ Right $ S.fromList [head $ leaves l, head $ leaves r] _ -> Just $ Left $ "findNode: degree two node found" <> show n- | otherwise = case catMaybes $ map (go x) ts of+ | otherwise = case mapMaybe (go x) ts of [] -> Nothing [z] -> Just z -- Use 'error' because this should never happen since we check for
src/ELynx/Tree/Name.hs view
@@ -25,9 +25,6 @@ import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy.Char8 as BL import Data.Default.Class--- TODO: 2021-09-02: Native conversion is being implemented at the moment.--- Remove external library when this is available.-import qualified Data.Double.Conversion.ByteString as BC import Data.String -- | Node name.@@ -64,7 +61,7 @@ getName = Name . BB.toLazyByteString . BB.intDec instance HasName Double where- getName = Name . BL.fromStrict . BC.toShortest+ getName = Name . BB.toLazyByteString . BB.doubleDec instance HasName Char where getName = Name . BB.toLazyByteString . BB.char8