application: fdnaml [
  documentation: "Estimate nucleotide phylogeny by maximum
                  likelihood"
  groups: "Phylogeny:Molecular sequence"
  embassy: "phylipnew"
  relations:  "EDAM_topic:0084 Phylogenetics"
  relations:  "EDAM_operation:0547 Phylogenetic tree construction (maximum likelihood and Bayesian methods)"
]

section: input [
  information: "Input section"
  type: "page"
]

  seqsetall: sequence [
    parameter: "Y"
    type: "gapdnaphylo"
    aligned: "Y"
    help: "File containing one or more sequence alignments"
    relations: "EDAM_data:1383 Sequence alignment (nucleic acid)"
  ]

  tree: intreefile [
    parameter: "Y"
    nullok: "Y"
    knowntype: "newick"
    information: "Phylip tree file (optional)"
    relations:  "EDAM_data:0872 Phylogenetic tree"
  ]

  integer: ncategories [
    additional: "Y"
    default: "1"
    minimum: "1"
    maximum: "9"
    information: "Number of substitution rate categories"
    relations: "EDAM_data:2527 Parameter"
  ]

  array: rate [
    additional: "@($(ncategories) > 1)"
    information: "Rate for each category"
    size: "$(ncategories)"
    sumtest: "N"
    relations: "EDAM_data:2527 Parameter"
  ]

  properties: categories [
    additional: "@($(ncategories) > 1)"
    characters: "1-$(ncategories)"
    information: "File of substitution rate categories"
    nullok: "@($(ncategories) == 1)"
    size: "1"
    length: "$(sequence.length)"
    relations: "EDAM_data:1427 Phylogenetic discrete data"
  ]

  properties: weights [
    additional: "Y"
    characters: "01"
    information: "Weights file"
    help: "Weights file"
    length: "$(sequence.length)"
    size: "@(@($(sequence.multicount)>1) ? 1:0)"
    nullok: "Y"
    relations: "EDAM_data:2994 Phylogenetic character weights"
  ]

endsection: input

section: additional [
  information: "Additional section"
  type: "page"
]

  boolean: lengths [
    additional: "$(intreefile.isdefined)"
    default: "N"
    information: "Use branch lengths from user trees"
    relations: "EDAM_data:2527 Parameter"
  ]

  float: ttratio [
    additional: "Y"
    default: "2.0"
    minimum: "0.001"
    information: "Transition/transversion ratio"
    relations: "EDAM_data:2527 Parameter"
  ]

  toggle: freqsfrom [
    additional: "Y"
    default: "Y"
    information: "Use empirical base frequencies from seqeunce
                  input"
    relations: "EDAM_data:2527 Parameter"
  ]

  array: basefreq [
    additional: "@(!$(freqsfrom))"
    size: "4"
    minimum: "0.0"
    maximum: "1.0"
    default: "0.25 0.25 0.25 0.25"
    information: "Base frequencies for A C G T/U (use blanks to
                  separate)"
    sum: "1.0"
    relations: "EDAM_data:2527 Parameter"
  ]

  list: gammatype [
    additional: "Y"
    minimum: "1"
    maximum: "1"
    header: "Rate variation among sites"
    values: "g:Gamma distributed rates; i:Gamma+invariant sites;
             h:User defined HMM of rates; n:Constant rate"
    information: "Rate variation among sites"
    default: "Constant rate"
    relations: "EDAM_data:2527 Parameter"
  ]

  float: gammacoefficient [
    additional: "@($(gammatype)==g)"
    information: "Coefficient of variation of substitution rate
                  among sites"
    minimum: "0.001"
    default: "1"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: ngammacat [
    additional: "@($(gammatype)==g)"
    minimum: "1"
    maximum: "9"
    default: "1"
    information: "Number of categories (1-9)"
    relations: "EDAM_data:2527 Parameter"
  ]

  float: invarcoefficient [
    additional: "@($(gammatype)==i)"
    information: "Coefficient of variation of substitution rate
                  among sites"
    minimum: "0.001"
    default: "1"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: ninvarcat [
    additional: "@($(gammatype)==i)"
    minimum: "1"
    maximum: "9"
    default: "1"
    information: "Number of categories (1-9) including one for
                  invariant sites"
    relations: "EDAM_data:2527 Parameter"
  ]

  float: invarfrac [
    additional: "@($(gammatype)==i)"
    information: "Fraction of invariant sites"
    default: "0.0"
    minimum: "0.0"
    maximum: "0.9999"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: nhmmcategories [
    additional: "@($(gammatype)==h)"
    default: "1"
    minimum: "1"
    maximum: "9"
    information: "Number of HMM rate categories"
    relations: "EDAM_data:2527 Parameter"
  ]

  array: hmmrates [
    additional: "@($(nhmmcategories) > 1)"
    information: "HMM category rates"
    default: "1.0"
    minimum: "0.0"
    size: "$(nhmmcategories)"
    sumtest: "N"
    relations: "EDAM_data:2527 Parameter"
  ]

  array: hmmprobabilities [
    additional: "@($(nhmmcategories) > 1)"
    information: "Probability for each HMM category"
    default: "1.0"
    minimum: "0.0"
    maximum: "1.0"
    size: "$(nhmmcategories)"
    sum: "1.0"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: adjsite [
    additional: "@($(gammatype)!=n)"
    default: "N"
    information: "Rates at adjacent sites correlated"
    relations: "EDAM_data:2527 Parameter"
  ]

  float: lambda [
    additional: "$(adjsite)"
    default: "1.0"
    information: "Mean block length of sites having the same
                  rate"
    minimum: "1.0"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: njumble [
    additional: "@(!$(intreefile.isdefined))"
    default: "0"
    minimum: "0"
    information: "Number of times to randomise"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: seed [
    additional: "$(njumble)"
    information: "Random number seed between 1 and 32767 (must
                  be odd)"
    maximum: "32767"
    minimum: "1"
    default: "1"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: global [
    additional: "@(!$(intreefile.isdefined))"
    default: "N"
    information: "Global rearrangements"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: outgrno [
    additional: "Y"
    minimum: "0"
    maximum: "$(sequence.count)"
    failrange: "N"
    trueminimum: "Y"
    default: "0"
    information: "Species number to use as outgroup"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: rough [
    additional: "Y"
    default: "Y"
    information: "Speedier but rougher analysis"
    relations: "EDAM_data:2527 Parameter"
  ]

endsection: additional

section: output [
  information: "Output section"
  type: "page"
]

  outfile: outfile [
    parameter: "Y"
    knowntype: "dnaml output"
    information: "Phylip dnaml program output file"
    relations:  "EDAM_data:0872 Phylogenetic tree"
  ]

  toggle: trout [
    additional: "Y"
    default: "Y"
    information: "Write out trees to tree file"
    relations: "EDAM_data:2527 Parameter"
  ]

  outfile: outtreefile [
    additional: "$(trout)"
    extension: "treefile"
    information: "Phylip tree output file (optional)"
    knowntype: "newick tree"
    nullok: "Y"
    relations:  "EDAM_data:0872 Phylogenetic tree"
  ]

  boolean: printdata [
    additional: "Y"
    default: "N"
    information: "Print data at start of run"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: progress [
    additional: "Y"
    default: "Y"
    information: "Print indications of progress of run"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: treeprint [
    additional: "Y"
    default: "Y"
    information: "Print out tree"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: hypstate [
    additional: "Y"
    default: "N"
    information: "Reconstruct hypothetical sequence"
    relations: "EDAM_data:2527 Parameter"
  ]

endsection: output
