{-# LANGUAGE DeriveGeneric #-}
module TLynx.Examine.Options
( ExamineArguments (..),
examineArguments,
)
where
import ELynx.Tools
import Options.Applicative
import TLynx.Parsers
data ExamineArguments = ExamineArguments
{ ExamineArguments -> FilePath
argsInFile :: FilePath,
ExamineArguments -> NewickFormat
argsNewickFormat :: NewickFormat
}
deriving (ExamineArguments -> ExamineArguments -> Bool
(ExamineArguments -> ExamineArguments -> Bool)
-> (ExamineArguments -> ExamineArguments -> Bool)
-> Eq ExamineArguments
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExamineArguments -> ExamineArguments -> Bool
$c/= :: ExamineArguments -> ExamineArguments -> Bool
== :: ExamineArguments -> ExamineArguments -> Bool
$c== :: ExamineArguments -> ExamineArguments -> Bool
Eq, Int -> ExamineArguments -> ShowS
[ExamineArguments] -> ShowS
ExamineArguments -> FilePath
(Int -> ExamineArguments -> ShowS)
-> (ExamineArguments -> FilePath)
-> ([ExamineArguments] -> ShowS)
-> Show ExamineArguments
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [ExamineArguments] -> ShowS
$cshowList :: [ExamineArguments] -> ShowS
show :: ExamineArguments -> FilePath
$cshow :: ExamineArguments -> FilePath
showsPrec :: Int -> ExamineArguments -> ShowS
$cshowsPrec :: Int -> ExamineArguments -> ShowS
Show, (forall x. ExamineArguments -> Rep ExamineArguments x)
-> (forall x. Rep ExamineArguments x -> ExamineArguments)
-> Generic ExamineArguments
forall x. Rep ExamineArguments x -> ExamineArguments
forall x. ExamineArguments -> Rep ExamineArguments x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExamineArguments x -> ExamineArguments
$cfrom :: forall x. ExamineArguments -> Rep ExamineArguments x
Generic)
instance Reproducible ExamineArguments where
inFiles :: ExamineArguments -> [FilePath]
inFiles = FilePath -> [FilePath]
forall (f :: * -> *) a. Applicative f => a -> f a
pure (FilePath -> [FilePath])
-> (ExamineArguments -> FilePath) -> ExamineArguments -> [FilePath]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExamineArguments -> FilePath
argsInFile
outSuffixes :: ExamineArguments -> [FilePath]
outSuffixes ExamineArguments
_ = [FilePath
".out"]
getSeed :: ExamineArguments -> Maybe SeedOpt
getSeed ExamineArguments
_ = Maybe SeedOpt
forall a. Maybe a
Nothing
setSeed :: ExamineArguments -> SeedOpt -> ExamineArguments
setSeed = ExamineArguments -> SeedOpt -> ExamineArguments
forall a b. a -> b -> a
const
parser :: Parser ExamineArguments
parser = Parser ExamineArguments
examineArguments
cmdName :: FilePath
cmdName = FilePath
"examine"
cmdDsc :: [FilePath]
cmdDsc = [FilePath
"Compute summary statistics of phylogenetic trees."]
instance FromJSON ExamineArguments
instance ToJSON ExamineArguments
examineArguments :: Parser ExamineArguments
examineArguments :: Parser ExamineArguments
examineArguments = FilePath -> NewickFormat -> ExamineArguments
ExamineArguments (FilePath -> NewickFormat -> ExamineArguments)
-> Parser FilePath -> Parser (NewickFormat -> ExamineArguments)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser FilePath
inFile Parser (NewickFormat -> ExamineArguments)
-> Parser NewickFormat -> Parser ExamineArguments
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser NewickFormat
newickFormat
inFile :: Parser FilePath
inFile :: Parser FilePath
inFile =
Mod ArgumentFields FilePath -> Parser FilePath
forall s. IsString s => Mod ArgumentFields s -> Parser s
strArgument (Mod ArgumentFields FilePath -> Parser FilePath)
-> Mod ArgumentFields FilePath -> Parser FilePath
forall a b. (a -> b) -> a -> b
$ FilePath -> Mod ArgumentFields FilePath
forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
metavar FilePath
"INPUT-FILE" Mod ArgumentFields FilePath
-> Mod ArgumentFields FilePath -> Mod ArgumentFields FilePath
forall a. Semigroup a => a -> a -> a
<> FilePath -> Mod ArgumentFields FilePath
forall (f :: * -> *) a. FilePath -> Mod f a
help FilePath
"Read trees from INPUT-FILE"