application: fprotdist [
  documentation: "Protein distance algorithm"
  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: "gapproteinphylo"
    aligned: "Y"
    help: "File containing one or more sequence alignments"
    relations: "EDAM_data:1384 Sequence alignment (protein)"
  ]

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

  list: method [
    additional: "y"
    minimum: "1"
    maximum: "1"
    header: "Method"
    values: "j:Jones-Taylor-Thornton matrix; h:Henikoff/Tiller PMB
             matrix; d:Dayhoff PAM matrix; k:Kimura formula; s:Similarity
             table; c:Categories model"
    information: "Choose the method to use"
    default: "j"
    relations: "EDAM_data:2527 Parameter"
  ]

  list: gammatype [
    additional: "@($(method) == { j | h | d | c })"
    minimum: "1"
    maximum: "1"
    header: "Rate variation among sites"
    values: "g:Gamma distributed rates; i:Gamma+invariant sites;
             c:Constant rate"
    information: "Rate variation among sites"
    default: "c"
    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"
  ]

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

  list: aacateg [
    additional: "@($(method) == c)"
    minimum: "1"
    maximum: "1"
    header: "Which categorizations of amino acids to use - all have
             groups: (Glu Gln Asp Asn), (Lys Arg His), (Phe Tyr Trp)plus:"
    values: "G:George/Hunt/Barker (Cys), (Met Val Leu Ileu), (Gly
             Ala Ser Thr Pro); C:Chemical (Cys Met), (Val Leu Ileu Gly Ala
             Ser Thr), (Pro); H:Hall (Cys), (Met Val Leu Ileu), (Gly Ala Ser
             Thr),(Pro)"
    information: "Choose the category to use"
    default: "G"
    relations: "EDAM_data:2527 Parameter"
  ]

  list: whichcode [
    additional: "@($(method) == c)"
    minimum: "1"
    maximum: "1"
    header: "Which genetic code"
    values: "u:Universal; c:Ciliate; m:Universal mitochondrial;
             v:Vertebrate mitochondrial; f:Fly mitochondrial; y:Yeast
             mitochondrial"
    information: "Which genetic code"
    default: "u"
    relations: "EDAM_data:2527 Parameter"
  ]

  float: ease [
    additional: "@($(method) == c)"
    minimum: "0.0"
    maximum: "1.0"
    default: "0.457"
    information: "Prob change category (1.0=easy)"
    relations: "EDAM_data:2527 Parameter"
  ]

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

  array: basefreq [
    additional: "@($(method) == c)"
    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"
  ]

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
