application: fprotdist [
  documentation: "Protein distance algorithm"
  groups: "Phylogeny:Molecular sequence"
  embassy: "phylipnew"
]

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

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

  array: rate [
    additional: "@($(ncategories) > 1)"
    information: "Rate for each category"
    size: "$(ncategories)"
    sumtest: "N"
    relations: "EDAM: Generic float array"                                 
  ]

  properties: categories [
    additional: "@($(ncategories) > 1)"
    characters: "1-$(ncategories)"
    information: "File of substitution rate categories"
    nullok: "@($(ncategories) == 1)"
    size: "1"
    length: "$(sequence.length)"
    relations: "EDAM: PHYLIP phylogenetic property values file"            
  ]

  properties: weights [
    additional: "Y"
    characters: "01"
    information: "Weights file"
    length: "$(sequence.length)"
    size: "@(@($(sequence.multicount)>1) ? 1:0)"
    nullok: "Y"
    relations: "EDAM: PHYLIP phylogenetic property values file"            
  ]

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

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

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

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

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

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

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

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

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

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
