application: fdnadist [
  documentation: "Nucleic acid sequence distance matrix
                  program"
  groups: "Phylogeny:Molecular sequence"
  embassy: "phylipnew"
  relations:  "EDAM_topic:0084 Phylogenetics"
  relations:  "EDAM_operation:0289 Sequence distance matrix generation"
]

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:2887 Sequence record (nucleic acid)"
  ]

  list: method [
    standard: "y"
    minimum: "1"
    maximum: "1"
    header: "Distance methods"
    values: "f:F84 distance model; k:Kimura 2-parameter distance;
             j:Jukes-Cantor distance; l:LogDet distance; s:Similarity table"
    information: "Choose the method to use"
    default: "F84 distance model"
    relations: "EDAM_data:2527 Parameter"
  ]

  list: gammatype [
    additional: "@( $(method) == { f | k | j } )"
    minimum: "1"
    maximum: "1"
    header: "Gamma distribution"
    values: "g:Gamma distributed rates; i:Gamma+invariant sites;
             n:No distribution parameters used"
    information: "Gamma distribution"
    default: "No distribution parameters used"
    relations: "EDAM_data:2527 Parameter"
  ]

  integer: ncategories [
    additional: "@(@($(method) == { f | k | j } ) & @($(gammatype)
                 == n))"
    default: "1"
    minimum: "1"
    maximum: "9"
    information: "Number of substitution rate categories"
    relations: "EDAM_data:2527 Parameter"
  ]

  array: rate [
    additional: "@($(ncategories) > 1)"
    information: "Category rates"
    default: "1.0"
    minimum: "0.0"
    size: "$(ncategories)"
    sumtest: "N"
    relations: "EDAM_data:2527 Parameter"
  ]

  properties: categories [
    additional: "@($(ncategories) > 1)"
    characters: "1-$(ncategories)"
    help: "File of substitution rate categories"
    nullok: "Y"
    relations: "EDAM_data:1427 Phylogenetic discrete data"
  ]

  properties: weights [
    additional: "Y"
    characters: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    information: "Weights file"
    length: "$(sequence.length)"
    nullok: "Y"
    relations: "EDAM_data:2994 Phylogenetic character weights"
  ]

endsection: input

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

  float: gammacoefficient [
    additional: "@($(gammatype) != n)"
    information: "Coefficient of variation of substitution rate
                  among sites"
    minimum: "0.001"
    default: "1"
    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"
  ]

  float: ttratio [
    additional: "@( @($(method) == f) | @($(method) == k))"
    information: "Transition/transversion ratio"
    default: "2.0"
    minimum: "0.001"
    relations: "EDAM_data:2527 Parameter"
  ]

  toggle: freqsfrom [
    additional: "@($(method) == f)"
    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"
  ]

  boolean: lower [
    additional: "Y"
    default: "N"
    information: "Output as a lower triangular distance matrix"
    relations: "EDAM_data:2527 Parameter"
  ]

  boolean: humanreadable [
    additional: "Y"
    default: "@($(method)==s?Y:N)"
    information: "Output as a human-readable distance matrix"
    relations: "EDAM_data:2527 Parameter"
  ]

endsection: additional

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

  outfile: outfile [
    parameter: "Y"
    knowntype: "distance matrix"
    information: "Phylip distance matrix output file"
    relations:  "EDAM_data:0870 Sequence distance matrix"
  ]

  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"
  ]

endsection: output
