appl: compseq [
  documentation: "Counts the composition of dimer/trimer/etc words in a sequence"
  groups: "Nucleic:Composition, Protein:Composition"
]

section: input [ info: "input Section" type: page ]
seqall: sequence  [
  parameter: "Y"
]

endsection: input

section: required [ info: "required Section" type: page ]
integer: word  [
  parameter: "Y"
  minimum: "1"
  default: "2"
  maximum: "20"
  information: "Word size to consider (e.g. 2=dimer)"
  help: "This is the size of word (n-mer) to count. \ Thus if you want to count codon frequencies, you should enter 3 here."
]

endsection: required

section: advanced [ info: "advanced Section" type: page ]
infile: infile  [
  optional: "Y"
  nullok: "Y"
  information: "'compseq' file to use for expected word frequencies"
  help: "This is a file previously produced by 'compseq' that can be used to set the expected frequencies of words in this analysis. \ The word size in the current run must be the same as the one in this results file. Obviously, you should use a file produced from protein sequences if you are counting protein sequence word frequencies, and you must use one made from nucleotide frequencies if you and analysing a nucleotide sequence."
]

integer: frame  [
  optional: "Y"
  default: "0"
  minimum: "0"
  maximum: "$(word)"
  information: "Frame of word to look at (0=all frames)"
  help: "The normal behaviour of 'compseq' is to count the frequencies of all words that occur by moving a window of length 'word' up by one each time. \ This option allows you to move the window up by the length of the word each time, skipping over the intervening words. \ You can count only those words that occur in a single frame of the word by setting this value to a number other than zero. \ If you set it to 1 it will only count the words in frame 1, 2 will only count the words in frame 2 and so on."
]

bool: ignorebz  [
  optional: "$(sequence.protein)"
  default: "Y"
  information: "Ignore the amino acids B and Z and just count them as 'Other'"
  help: "The amino acid code B represents Asparagine or Aspartic acid and the code Z represents Glutamine or Glutamic acid. \ These are not commonly used codes and you may wish not to count words containing them, just noting them in the count of 'Other' words."
]

bool: reverse  [
  optional: "@(!$(sequence.protein))"
  default: "N"
  information: "Count words in the forward and reverse sense"
  help: "Set this to be true if you also wish to also count words in the reverse complement of a nucleic sequence."
]
endsection: advanced

section: output [ info: "output Section" type: page ]
outfile: outfile  [
  parameter: "Y"
  extension: "composition"
  help: "This is the results file."
]

bool: zerocount  [
  optional: "Y"
  default: "Y"
  information: "Display the words that have a frequency of zero"
  help: "You can make the output results file much smaller if you do not display the words with a zero count."
]

endsection: output
