{-# LANGUAGE DeriveGeneric #-}
module TLynx.Compare.Options
( CompareArguments (..),
compareArguments,
)
where
import ELynx.Tools
import Options.Applicative
import TLynx.Parsers
data CompareArguments = CompareArguments
{ argsNormalize :: Bool,
argsBipartitions :: Bool,
argsIntersect :: Bool,
argsNewickFormat :: NewickFormat,
argsInFiles :: [FilePath]
}
deriving (Eq, Show, Generic)
instance Reproducible CompareArguments where
inFiles = argsInFiles
outSuffixes _ = [".out"]
getSeed _ = Nothing
setSeed a _ = a
parser = compareArguments
cmdName = "compare"
cmdDsc =
[ "Compare two phylogenetic trees (compute distances and branch-wise differences)."
]
instance FromJSON CompareArguments
instance ToJSON CompareArguments
compareArguments :: Parser CompareArguments
compareArguments =
CompareArguments
<$> normalize
<*> bipartitions
<*> intersect
<*> newickFormat
<*> file
normalize :: Parser Bool
normalize =
switch $
long "normalize" <> short 'n'
<> help
"Normalize trees before comparison"
bipartitions :: Parser Bool
bipartitions =
switch $
long "bipartitions" <> short 'b'
<> help
"Print and plot common and missing bipartitions"
intersect :: Parser Bool
intersect =
switch $
long "intersect"
<> short 't'
<> help
"Compare intersections; i.e., before comparison, drop leaves that are not present in the other tree"
file :: Parser [FilePath]
file = some $ strArgument $ metavar "NAMES" <> help "Tree files"