slynx 0.6.1.1 → 0.7.0.1
raw patch · 20 files changed
+181/−114 lines, 20 filesdep +matricesdep +randomdep −mwc-randomPVP ok
version bump matches the API change (PVP)
Dependencies added: matrices, random
Dependencies removed: mwc-random
API changes (from Hackage documentation)
+ SLynx.Examine.Options: [exDivergence] :: ExamineArguments -> Bool
- SLynx.Examine.Options: ExamineArguments :: Alphabet -> FilePath -> Bool -> ExamineArguments
+ SLynx.Examine.Options: ExamineArguments :: Alphabet -> FilePath -> Bool -> Bool -> ExamineArguments
Files
- ChangeLog.md +8/−1
- README.md +7/−8
- app/Main.hs +1/−1
- slynx.cabal +53/−50
- src/SLynx/Concatenate/Concatenate.hs +1/−1
- src/SLynx/Concatenate/Options.hs +1/−1
- src/SLynx/Examine/Examine.hs +45/−13
- src/SLynx/Examine/Options.hs +9/−4
- src/SLynx/Filter/Filter.hs +1/−1
- src/SLynx/Filter/Options.hs +5/−3
- src/SLynx/Options.hs +1/−1
- src/SLynx/SLynx.hs +1/−1
- src/SLynx/Simulate/Options.hs +15/−7
- src/SLynx/Simulate/PhyloModel.hs +1/−1
- src/SLynx/Simulate/Simulate.hs +9/−9
- src/SLynx/SubSample/Options.hs +4/−2
- src/SLynx/SubSample/SubSample.hs +7/−4
- src/SLynx/Tools.hs +4/−2
- src/SLynx/Translate/Options.hs +7/−3
- src/SLynx/Translate/Translate.hs +1/−1
ChangeLog.md view
@@ -5,9 +5,16 @@ ## Unreleased changes +## Version 0.7.0.1++- Random 1.2: Parallel functions now require an \`IOGenM\` random number+ generator.+- Fix splitting of the random number generator.++ ## Version 0.6.1.1 -- Remove plotting functionality (gnuplot incompatible with ghc921).+- Remove plotting functionality (gnuplot incompatible with ghc922). - Read files strictly. - Refactor; flatten model hierarchy.
README.md view
@@ -2,7 +2,7 @@ # The ELynx Suite -Version: 0.6.1.1.+Version: 0.7.0.0. Reproducible evolution made easy. <p align="center"><img src="https://travis-ci.org/dschrempf/elynx.svg?branch=master"/></p>@@ -74,9 +74,9 @@ # OR: slynx --help Up to date- ELynx Suite version 0.6.1.1.+ ELynx Suite version 0.7.0.0. Developed by Dominik Schrempf.- Compiled on February 22, 2022, at 15:10 pm, UTC.+ Compiled on July 10, 2022, at 08:48 am, UTC. Usage: slynx [-v|--verbosity VALUE] [-o|--output-file-basename NAME] [-f|--force] [--no-elynx-file] COMMAND@@ -144,16 +144,16 @@ # OR: slynx simulate --help Up to date- ELynx Suite version 0.6.1.1.+ ELynx Suite version 0.7.0.0. Developed by Dominik Schrempf.- Compiled on February 22, 2022, at 15:10 pm, UTC.+ Compiled on July 10, 2022, at 08:48 am, UTC. Usage: slynx simulate (-t|--tree-file Name) [-s|--substitution-model MODEL] [-m|--mixture-model MODEL] [-e|--edm-file NAME] [-p|--siteprofile-files NAMES] [-w|--mixture-model-weights "[DOUBLE,DOUBLE,...]"] [-g|--gamma-rate-heterogeneity "(NCAT,SHAPE)"]- (-l|--length NUMBER) [-S|--seed [INT]]+ (-l|--length NUMBER) [-S|--seed INT] Simulate multi sequence alignments. Available options:@@ -175,8 +175,7 @@ -g,--gamma-rate-heterogeneity "(NCAT,SHAPE)" Number of gamma rate categories and shape parameter -l,--length NUMBER Set alignment length to NUMBER- -S,--seed [INT] Seed for random number generator; list of 32 bit- integers with up to 256 elements (default: random)+ -S,--seed INT Seed for random number generator (default: random) -h,--help Show this help text Substitution models:
app/Main.hs view
@@ -1,7 +1,7 @@ -- | -- Module : Main -- Description : Work with molecular sequence data--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
slynx.cabal view
@@ -1,54 +1,54 @@-cabal-version: 3.0-name: slynx-version: 0.6.1.1-synopsis: Handle molecular sequences-description: Examine, modify, and simulate molecular sequences in a reproducible way. Please see the README on GitHub at <https://github.com/dschrempf/elynx>.-category: Bioinformatics-homepage: https://github.com/dschrempf/elynx#readme-bug-reports: https://github.com/dschrempf/elynx/issues-author: Dominik Schrempf-maintainer: dominik.schrempf@gmail.com-copyright: Dominik Schrempf (2021)-license: GPL-3.0-or-later-license-file: LICENSE-build-type: Simple+cabal-version: 3.0+name: slynx+version: 0.7.0.1+synopsis: Handle molecular sequences+description:+ Examine, modify, and simulate molecular sequences in a reproducible way. Please see the README on GitHub at <https://github.com/dschrempf/elynx>. +category: Bioinformatics+homepage: https://github.com/dschrempf/elynx#readme+bug-reports: https://github.com/dschrempf/elynx/issues+author: Dominik Schrempf+maintainer: dominik.schrempf@gmail.com+copyright: 2021 Dominik Schrempf+license: GPL-3.0-or-later+license-file: LICENSE+build-type: Simple extra-source-files:- README.md- ChangeLog.md+ ChangeLog.md+ README.md source-repository head- type: git+ type: git location: https://github.com/dschrempf/elynx library exposed-modules:- SLynx.Concatenate.Concatenate- SLynx.Concatenate.Options- SLynx.Examine.Examine- SLynx.Examine.Options- SLynx.Filter.Filter- SLynx.Filter.Options- SLynx.Options- SLynx.Simulate.Options- SLynx.Simulate.PhyloModel- SLynx.Simulate.Simulate- SLynx.SLynx- SLynx.SubSample.Options- SLynx.SubSample.SubSample- SLynx.Tools- SLynx.Translate.Options- SLynx.Translate.Translate- other-modules:- Paths_slynx- autogen-modules:- Paths_slynx- hs-source-dirs: src- ghc-options: -Wall -Wunused-packages+ SLynx.Concatenate.Concatenate+ SLynx.Concatenate.Options+ SLynx.Examine.Examine+ SLynx.Examine.Options+ SLynx.Filter.Filter+ SLynx.Filter.Options+ SLynx.Options+ SLynx.Simulate.Options+ SLynx.Simulate.PhyloModel+ SLynx.Simulate.Simulate+ SLynx.SLynx+ SLynx.SubSample.Options+ SLynx.SubSample.SubSample+ SLynx.Tools+ SLynx.Translate.Options+ SLynx.Translate.Translate++ other-modules: Paths_slynx+ autogen-modules: Paths_slynx+ hs-source-dirs: src+ ghc-options: -Wall -Wunused-packages build-depends:- aeson+ , aeson , attoparsec- , base >=4.7 && <5+ , base >=4.7 && <5 , bytestring , containers , elynx-markov@@ -56,23 +56,26 @@ , elynx-tools , elynx-tree , hmatrix- , mwc-random+ , matrices , optparse-applicative+ , random , statistics , text , transformers , vector+ default-language: Haskell2010 executable slynx- main-is: Main.hs- other-modules:- Paths_slynx- autogen-modules:- Paths_slynx- hs-source-dirs: app- ghc-options: -Wall -Wunused-packages -threaded -rtsopts -with-rtsopts=-N+ main-is: Main.hs+ other-modules: Paths_slynx+ autogen-modules: Paths_slynx+ hs-source-dirs: app+ ghc-options:+ -Wall -Wunused-packages -threaded -rtsopts -with-rtsopts=-N+ build-depends:- base >=4.7 && <5+ , base >=4.7 && <5 , slynx+ default-language: Haskell2010
src/SLynx/Concatenate/Concatenate.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Analyze.Analyze -- Description : Parse sequence file formats and analyze them--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
src/SLynx/Concatenate/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Concatenate.Options -- Description : ELynxSeq argument parsing--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
src/SLynx/Examine/Examine.hs view
@@ -5,7 +5,7 @@ -- -- Module : Analyze.Analyze -- Description : Parse sequence file formats and analyze them--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -18,21 +18,28 @@ ) where +import Control.Monad+import Control.Monad.IO.Class import Control.Monad.Trans.Reader import qualified Data.ByteString.Lazy.Char8 as BL+import qualified Data.Matrix.Unboxed as MU import qualified Data.Set as S import qualified Data.Vector.Unboxed as V import qualified ELynx.Alphabet.Alphabet as A import qualified ELynx.Alphabet.Character as C import qualified ELynx.Sequence.Alignment as M import qualified ELynx.Sequence.Distance as D+import ELynx.Sequence.Divergence import qualified ELynx.Sequence.Sequence as Seq import ELynx.Tools.ByteString import ELynx.Tools.ELynx import ELynx.Tools.Environment+import ELynx.Tools.Logger+import qualified Numeric.LinearAlgebra as L import SLynx.Examine.Options import SLynx.Tools import qualified Statistics.Sample as Sm+import System.IO import Text.Printf pRow :: String -> String -> BL.ByteString@@ -44,30 +51,29 @@ examineAlignment :: Bool -> M.Alignment -> BL.ByteString examineAlignment perSiteFlag a = BL.unlines- [ BL.pack- "Sequences have equal length (multi sequence alignment, or single sequence).",- BL.pack "Number of columns in alignment:",+ [ "Sequences have equal length (multi sequence alignment, or single sequence).",+ "Number of columns in alignment:", pRow " Total:" $ show aL, pRow " Constant:" $ show nConstant, pRow " Constant (including gaps or unknowns):" $ show nConstantSoft, pRow " Without gaps:" $ show (M.length aNoGaps), pRow " With standard characters only:" $ show (M.length aOnlyStd),- BL.empty,+ "", pRow "Total number of characters:" $ show nTot, pRow "Standard (i.e., not extended IUPAC) characters:" $ show (nTot - nIUPAC - nGaps - nUnknowns), pRow "Extended IUPAC characters:" $ show nIUPAC, pRow "Gaps:" $ show nGaps, pRow "Unknowns:" $ show nUnknowns,- BL.empty,+ "", pRow "Percentage of standard characters:" $ printf "%2.2f" (100.0 - percentIUPAC - percentGaps - percentUnknowns), pRow "Percentage of extended IUPAC characters:" $ printf "%2.2f" percentIUPAC, pRow "Percentage of gaps:" $ printf "%2.2f" percentGaps, pRow "Percentage of unknowns:" $ printf "%2.2f" percentUnknowns,- BL.empty,+ "", BL.pack "Distribution of characters:", -- Holy crap. BL.pack $@@ -77,24 +83,26 @@ A.alphabetSpec $ M.alphabet a, BL.pack $ unwords $ map (printf "%.3f") charFreqs,- BL.empty,+ "", BL.pack "Pairwise hamming distances (per site):", pRow " Mean:" $ printf "%.3f" hMean, pRow " Standard deviation:" $ printf "%.3f" $ sqrt hVar, pRow " Minimum:" $ printf "%.3f" hMin, pRow " Maximum:" $ printf "%.3f" hMax,- BL.empty,- BL.pack "Mean effective number of states (measured using entropy):",+ "",+ "Mean effective number of states (measured using entropy):", pRow "Across whole alignment:" $ printf "%.3f" kEffMean, pRow "Across columns without gaps:" $ printf "%.3f" kEffMeanNoGaps, pRow "Across columns without extended IUPAC characters:" $ printf "%.3f" kEffMeanOnlyStd,- BL.empty,+ "", BL.pack "Mean effective number of states (measured using homoplasy):", pRow "Across whole alignment:" $ printf "%.3f" kEffMeanHomo, pRow "Across columns without gaps:" $ printf "%.3f" kEffMeanNoGapsHomo, pRow "Across columns without extended IUPAC characters:" $- printf "%.3f" kEffMeanOnlyStdHomo+ printf "%.3f" kEffMeanOnlyStdHomo,+ "",+ "Divergence matrix:" ] <> perSiteBS where@@ -155,10 +163,34 @@ Left _ -> BL.empty Right a -> BL.pack "\n" <> examineAlignment perSiteFlag a +-- From https://stackoverflow.com/a/52602906/3536806.+tuples :: [a] -> [(a, a)]+tuples [] = []+tuples (x : xs) = map (\y -> (x, y)) xs ++ tuples xs++-- This is all ugly, but who cares.+writeDivergenceMatrix :: Handle -> (Seq.Sequence, Seq.Sequence, MU.Matrix Int) -> IO ()+writeDivergenceMatrix h (x, y, xs) = do+ BL.hPutStrLn h $ "> " <> Seq.name x <> ", " <> Seq.name y+ hPutStr h $ L.dispf 0 m+ where+ n = MU.rows xs+ m = L.matrix n $ map fromIntegral $ MU.toList xs++computeDivergenceMatrices :: [Seq.Sequence] -> ELynx ExamineArguments ()+computeDivergenceMatrices ss = do+ logInfoS "Compute divergence matrices."+ let xys = tuples ss+ ds = map (\(x, y) -> (x, y, either error id $ divergence x y)) xys+ h <- outHandle "divergence matrices" ".div"+ sequence_ $ map (liftIO . writeDivergenceMatrix h) ds+ liftIO $ hClose h+ -- | Examine sequences. examineCmd :: ELynx ExamineArguments () examineCmd = do- (ExamineArguments al inFile perSiteFlag) <- localArguments <$> ask+ (ExamineArguments al inFile perSiteFlag divergenceFlag) <- localArguments <$> ask ss <- readSeqs al inFile let result = examine perSiteFlag ss out "result of examination" result ".out"+ when divergenceFlag (computeDivergenceMatrices ss)
src/SLynx/Examine/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Examine.Options -- Description : ELynxSeq argument parsing--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -28,13 +28,14 @@ data ExamineArguments = ExamineArguments { exAlphabet :: Alphabet, exInFile :: FilePath,- exPerSite :: Bool+ exPerSite :: Bool,+ exDivergence :: Bool } deriving (Eq, Show, Generic) instance Reproducible ExamineArguments where inFiles = pure . exInFile- outSuffixes _ = [".out"]+ outSuffixes args = if exDivergence args then [".out", ".div"] else [".out"] getSeed _ = Nothing -- XXX: Probably throw error when seed is set.@@ -52,11 +53,15 @@ -- | Command line parser. examineArguments :: Parser ExamineArguments examineArguments =- ExamineArguments <$> alphabetOpt <*> filePathArg <*> examinePerSiteOpt+ ExamineArguments <$> alphabetOpt <*> filePathArg <*> examinePerSiteOpt <*> examineDivergence examinePerSiteOpt :: Parser Bool examinePerSiteOpt = switch $ long "per-site" <> help "Report per site summary statistics"++examineDivergence :: Parser Bool+examineDivergence =+ switch $ long "divergence" <> help "Compute pairwise divergence matrices" filePathArg :: Parser FilePath filePathArg =
src/SLynx/Filter/Filter.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Analyze.Analyze -- Description : Parse sequence file formats and analyze them--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
src/SLynx/Filter/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Filter.Options -- Description : ELynxSeq argument parsing--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -85,7 +85,8 @@ filterLongerThanOpt = optional $ option auto $- long "longer-than" <> metavar "LENGTH"+ long "longer-than"+ <> metavar "LENGTH" <> help "Only keep sequences longer than LENGTH" @@ -93,7 +94,8 @@ filterShorterThanOpt = optional $ option auto $- long "shorter-than" <> metavar "LENGTH"+ long "shorter-than"+ <> metavar "LENGTH" <> help "Only keep sequences shorter than LENGTH"
src/SLynx/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Options -- Description : SLynx general options--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
src/SLynx/SLynx.hs view
@@ -1,7 +1,7 @@ -- | -- Module : SLynx.SLynx -- Description : SLynx module--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
src/SLynx/Simulate/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Simulate.Options -- Description : ELynxSim argument parsing--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -69,8 +69,8 @@ instance Reproducible SimulateArguments where inFiles a =- argsTreeFile a :- (maybeToList (argsEDMFile a) ++ fromMaybe [] (argsSiteprofilesFiles a))+ argsTreeFile a+ : (maybeToList (argsEDMFile a) ++ fromMaybe [] (argsSiteprofilesFiles a)) outSuffixes _ = [".model.gz", ".fasta"] getSeed = Just . argsSeed setSeed a s = a {argsSeed = s}@@ -100,7 +100,9 @@ treeFileOpt :: Parser FilePath treeFileOpt = strOption $- long "tree-file" <> short 't' <> metavar "Name"+ long "tree-file"+ <> short 't'+ <> metavar "Name" <> help "Read tree from Newick file NAME" @@ -129,7 +131,9 @@ maybeEDMFileOpt = optional $ strOption- ( long "edm-file" <> short 'e' <> metavar "NAME"+ ( long "edm-file"+ <> short 'e'+ <> metavar "NAME" <> help "Empirical distribution model file NAME in Phylobayes format" )@@ -139,7 +143,9 @@ optional $ words <$> strOption- ( long "siteprofile-files" <> short 'p' <> metavar "NAMES"+ ( long "siteprofile-files"+ <> short 'p'+ <> metavar "NAMES" <> help "File names of site profiles in Phylobayes format" )@@ -170,7 +176,9 @@ lengthOpt = option auto- ( long "length" <> short 'l' <> metavar "NUMBER"+ ( long "length"+ <> short 'l'+ <> metavar "NUMBER" <> help "Set alignment length to NUMBER" )
src/SLynx/Simulate/PhyloModel.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Simulate.PhyloModel -- Description : Parse and interpret the model string--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com
src/SLynx/Simulate/Simulate.hs view
@@ -4,7 +4,7 @@ -- | -- Module : SLynx.Simulate.Simulate -- Description : Simulate multiple sequence alignments--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -56,7 +56,7 @@ import qualified Numeric.LinearAlgebra as L import SLynx.Simulate.Options import SLynx.Simulate.PhyloModel-import System.Random.MWC+import System.Random.Stateful import Text.Printf -- Display a vector with given precision.@@ -91,11 +91,11 @@ -- Simulate a 'Alignment' for a given phylogenetic model, -- phylogenetic tree, and alignment length. simulateAlignment ::- (HasLength e, HasName a) =>+ (RandomGen g, HasLength e, HasName a) => MP.PhyloModel -> Tree e a -> Int ->- GenIO ->+ IOGenM g -> ELynx SimulateArguments () simulateAlignment pm t' n g = do let t = fromLength . getLength <$> toTreeBranchLabels t'@@ -182,8 +182,8 @@ summarizeSM :: MS.SubstitutionModel -> [BL.ByteString] summarizeSM sm = map BL.pack $- (show (MS.alphabet sm) ++ " substitution model: " ++ MS.name sm ++ ".") :- ["Parameters: " ++ show (MS.params sm) ++ "." | not (null (MS.params sm))]+ (show (MS.alphabet sm) ++ " substitution model: " ++ MS.name sm ++ ".")+ : ["Parameters: " ++ show (MS.params sm) ++ "." | not (null (MS.params sm))] ++ case MS.alphabet sm of DNA -> [ "Stationary distribution: "@@ -208,8 +208,8 @@ summarizeMMComponent :: MM.Component -> [BL.ByteString] summarizeMMComponent c = BL.pack "Weight: "- <> (BB.toLazyByteString . BB.doubleDec $ MM.weight c) :- summarizeSM (MM.substModel c)+ <> (BB.toLazyByteString . BB.doubleDec $ MM.weight c)+ : summarizeSM (MM.substModel c) -- Summarize a mixture model; lines to be printed to screen or log. summarizeMM :: MM.MixtureModel -> [BL.ByteString]@@ -297,7 +297,7 @@ logInfoS "Simulate alignment." let alignmentLength = argsLength l logInfoS $ "Length: " <> show alignmentLength <> "."- gen <- liftIO <$> initialize $ case argsSeed l of+ gen <- newIOGenM $ mkStdGen $ case argsSeed l of RandomUnset -> error "simulateCmd: seed not available; please contact maintainer." RandomSet s -> s Fixed s -> s
src/SLynx/SubSample/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.SubSample.Options -- Description : ELynxSeq argument parsing--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -83,7 +83,9 @@ subSampleNSitesOpt :: Parser Int subSampleNSitesOpt = option auto $- long "number-of-sites" <> short 'n' <> metavar "INT"+ long "number-of-sites"+ <> short 'n'+ <> metavar "INT" <> help "Number of sites randomly drawn with replacement"
src/SLynx/SubSample/SubSample.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Analyze.Analyze -- Description : Parse sequence file formats and analyze them--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -28,16 +28,19 @@ import ELynx.Tools.Reproduction import SLynx.SubSample.Options import SLynx.Tools-import System.Random.MWC+import System.Random.Stateful -- | Sub sample sequences. subSampleCmd :: ELynx SubSampleArguments () subSampleCmd = do- (SubSampleArguments al inFile nSites nAlignments (Fixed s)) <- localArguments <$> ask+ (SubSampleArguments al inFile nSites nAlignments sOpt) <- localArguments <$> ask+ let s = case fromSeedOpt sOpt of+ Nothing -> error "subSampleCmd: No seed."+ Just x -> x logInfoS $ " Sample " <> show nSites <> " sites." logInfoS $ " Sample " <> show nAlignments <> " multi sequence alignments." ss <- readSeqs al inFile- gen <- liftIO $ initialize s+ gen <- newIOGenM $ mkStdGen s let a = either error id (M.fromSequences ss) samples <- liftIO $ replicateM nAlignments $ M.randomSubSample nSites a gen let results = map (sequencesToFasta . M.toSequences) samples
src/SLynx/Tools.hs view
@@ -4,7 +4,7 @@ -- | -- Module : SLynx.Tools -- Description : Common tools for sequence lynx--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -48,6 +48,8 @@ alphabetOpt :: Parser Alphabet alphabetOpt = option auto $- long "alphabet" <> short 'a' <> metavar "NAME"+ long "alphabet"+ <> short 'a'+ <> metavar "NAME" <> help "Specify alphabet type NAME"
src/SLynx/Translate/Options.hs view
@@ -3,7 +3,7 @@ -- | -- Module : SLynx.Translate.Options -- Description : ELynxSeq argument parsing--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com@@ -60,14 +60,18 @@ readingFrameOpt :: Parser Int readingFrameOpt = option auto $- long "reading-frame" <> short 'r' <> metavar "INT"+ long "reading-frame"+ <> short 'r'+ <> metavar "INT" <> help "Reading frame [0|1|2]." universalCodeOpt :: Parser UniversalCode universalCodeOpt = option auto $- long "universal-code" <> short 'u' <> metavar "CODE"+ long "universal-code"+ <> short 'u'+ <> metavar "CODE" <> help ("universal code; one of: " ++ codeStr ++ ".") where
src/SLynx/Translate/Translate.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Analyze.Analyze -- Description : Parse sequence file formats and analyze them--- Copyright : (c) Dominik Schrempf 2021+-- Copyright : 2021 Dominik Schrempf -- License : GPL-3.0-or-later -- -- Maintainer : dominik.schrempf@gmail.com