module Examine.Options
( ExamineArguments (..)
, Examine
, examineArguments
) where
import Control.Applicative (optional)
import Control.Monad.Logger
import Control.Monad.Trans.Reader
import Data.Maybe (fromJust)
import Options.Applicative
import Tools
import ELynx.Data.Alphabet.Alphabet
import ELynx.Tools.Reproduction
data ExamineArguments = ExamineArguments
{ exAlphabet :: Alphabet
, exInFile :: Maybe FilePath
, exPerSite :: Bool }
instance Reproducible ExamineArguments where
inFiles = pure . fromJust . exInFile
parser _ = examineArguments
type Examine = LoggingT (ReaderT ExamineArguments IO)
examineArguments :: Parser ExamineArguments
examineArguments = ExamineArguments
<$> alphabetOpt
<*> optional filePathArg
<*> examinePerSiteOpt
examinePerSiteOpt :: Parser Bool
examinePerSiteOpt = switch $
long "per-site" <>
help "Report per site summary statistics"
filePathArg :: Parser FilePath
filePathArg = strArgument $
metavar "INPUT-FILE" <>
help "Read sequences from INPUT-FILE"