application: fdnadist [
  documentation: "Nucleic acid sequence Distance Matrix
                  program"
  groups: "Phylogeny:Molecular sequence"
  embassy: "phylipnew"
]

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: DNA sequence record"                                 
  ]

  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: Generic string array"                                
  ]

  list: gamma [
    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: Generic string array"                                
  ]

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

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

  properties: categories [
    additional: "@($(ncategories) > 1)"
    characters: "1-$(ncategories)"
    help: "File of substitution rate categories"
    nullok: "Y"
    relations: "EDAM: PHYLIP phylogenetic property values file"            
  ]

  properties: weights [
    additional: "Y"
    characters: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    information: "Weights file"
    length: "$(sequence.length)"
    nullok: "Y"
    relations: "EDAM: PHYLIP phylogenetic property values file"            
  ]

endsection: input

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

  float: gammacoefficient [
    additional: "@($(gamma) != n)"
    information: "Coefficient of variation of substitution rate
                  among sites"
    minimum: "0.001"
    default: "1"
    relations: "EDAM: Generic float"                                       
  ]

  float: invarfrac [
    additional: "@($(gamma)==i)"
    information: "Fraction of invariant sites"
    default: "0.0"
    minimum: "0.0"
    maximum: "0.9999"
    relations: "EDAM: Generic float"                                       
  ]

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

  toggle: freqsfrom [
    additional: "@($(method) == f)"
    default: "Y"
    information: "Use empirical base frequencies from seqeunce
                  input"
    relations: "EDAM: Generic boolean"                                     
  ]

  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: Generic float array"                                 
  ]

  boolean: lower [
    additional: "Y"
    default: "N"
    information: "Output as a lower triangular distance matrix"
    relations: "EDAM: Generic boolean"                                     
  ]

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

endsection: additional

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

  outfile: outfile [
    parameter: "Y"
    knowntype: "distance matrix"
    information: "Phylip distance matrix output file"
    relations:  "EDAM: PHYLIP phylogenetic distance matrix file"       
  ]

  boolean: printdata [
    additional: "Y"
    default: "N"
    information: "Print data at start of run"
    relations: "EDAM: Generic boolean"                                     
  ]

  boolean: progress [
    additional: "Y"
    default: "Y"
    information: "Print indications of progress of run"
    relations: "EDAM: Generic boolean"                                     
  ]

endsection: output
