application: extractfeat [
  documentation: "Extract features from sequence(s)"
  groups: "Edit, Feature tables"
]

section: input [
  information: "Input section"
  type: "page"
]

  seqall: sequence [
    parameter: "Y"
    type: "any"
    features: "Y"
  ]

endsection: input

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

  integer: before [
    additional: "Y"
    default: "0"
    information: "Amount of sequence before feature to extract"
    help: "If this value is greater than 0 then that number of bases
           or residues before the feature are included in the extracted
           sequence. This allows you to get the context of the feature. If
           this value is negative then the start of the extracted sequence
           will be this number of bases/residues before the end of the
           feature. So a value of '10' will start the extraction 10
           bases/residues before the start of the sequence, and a value of
           '-10' will start the extraction 10 bases/residues before the end
           of the feature. The output sequence will be padded with 'N' or 'X'
           characters if the sequence starts after the required start of the
           extraction."
  ]

  integer: after [
    additional: "Y"
    default: "0"
    information: "Amount of sequence after feature to extract"
    help: "If this value is greater than 0 then that number of bases
           or residues after the feature are included in the extracted
           sequence. This allows you to get the context of the feature. If
           this value is negative then the end of the extracted sequence will
           be this number of bases/residues after the start of the feature.
           So a value of '10' will end the extraction 10 bases/residues after
           the end of the sequence, and a value of '-10' will end the
           extraction 10 bases/residues after the start of the feature. The
           output sequence will be padded with 'N' or 'X' characters if the
           sequence ends before the required end of the extraction."
  ]

  string: source [
    additional: "Y"
    default: "*"
    information: "Source of feature to display"
    help: "By default any feature source in the feature table is
           shown. You can set this to match any feature source you wish to
           show. \
           The source name is usually either the name of the program that
           detected the feature or it is the feature table (eg: EMBL) that
           the feature came from. \
           The source may be wildcarded by using '*'. \
           If you wish to show more than one source, separate their names
           with the character '|', eg: \
           gene* | embl"
    knowntype: "feature source list"
  ]

  string: type [
    additional: "Y"
    default: "*"
    information: "Type of feature to extract"
    help: "By default every feature in the feature table is extracted.
           You can set this to be any feature type you wish to extract. \
           See http://www3.ebi.ac.uk/Services/WebFeat/ for a list of the EMBL
           feature types and see Appendix A of the Swissprot user manual in
           http://www.expasy.ch/txt/userman.txt for a list of the Swissprot
           feature types. \
           The type may be wildcarded by using '*'. \
           If you wish to extract more than one type, separate their names
           with the character '|', eg: \
           *UTR | intron"
    knowntype: "feature key list"
  ]

  integer: sense [
    additional: "Y"
    default: "0"
    information: "Sense of feature to extract"
    expected: "0 - any sense, 1 - forward sense, -1 - reverse
               sense"
    help: "By default any feature type in the feature table is
           extracted. You can set this to match any feature sense you wish. 0
           - any sense, 1 - forward sense, -1 - reverse sense"
  ]

  float: minscore [
    additional: "Y"
    default: "0.0"
    information: "Minimum score of feature to extract"
    help: "If this is greater than or equal to the maximum score, then
           any score is permitted"
  ]

  float: maxscore [
    additional: "Y"
    default: "0.0"
    information: "Maximum score of feature to extract"
    help: "If this is less than or equal to the maximum score, then
           any score is permitted"
  ]

  string: tag [
    additional: "Y"
    default: "*"
    information: "Tag of feature to extract"
    help: "Tags are the types of extra values that a feature may have.
           For example in the EMBL feature table, a 'CDS' type of feature
           may have the tags '/codon', '/codon_start', '/db_xref',
           '/EC_number', '/evidence', '/exception', '/function', '/gene',
           '/label', '/map', '/note', '/number', '/partial', '/product',
           '/protein_id', '/pseudo', '/standard_name', '/translation',
           '/transl_except', '/transl_table', or '/usedin'. Some of these
           tags also have values, for example '/gene' can have the value of
           the gene name. \
           By default any feature tag in the feature table is extracted. You
           can set this to match any feature tag you wish to show. \
           The tag may be wildcarded by using '*'. \
           If you wish to extract more than one tag, separate their names
           with the character '|', eg: \
           gene | label"
    knowntype: "feature tag list"
  ]

  string: value [
    additional: "Y"
    default: "*"
    information: "Value of feature tags to extract"
    help: "Tag values are the values associated with a feature tag.
           Tags are the types of extra values that a feature may have. For
           example in the EMBL feature table, a 'CDS' type of feature may
           have the tags '/codon', '/codon_start', '/db_xref', '/EC_number',
           '/evidence', '/exception', '/function', '/gene', '/label', '/map',
           '/note', '/number', '/partial', '/product', '/protein_id',
           '/pseudo', '/standard_name', '/translation', '/transl_except',
           '/transl_table', or '/usedin'. Only some of these tags can have
           values, for example '/gene' can have the value of the gene name.
           By default any feature tag value in the feature table is shown.
           You can set this to match any feature tag valueyou wish to show. \
           The tag value may be wildcarded by using '*'. \
           If you wish to show more than one tag value, separate their names
           with a space or the character '|', eg: \
           pax* | 10"
    knowntype: "feature tagvalue list"
  ]

endsection: additional

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

  boolean: join [
    additional: "Y"
    default: "N"
    information: "Output introns etc. as one sequence"
    help: "Some features, such as CDS (coding sequence) and mRNA are
           composed of introns concatenated together. There may be other
           forms of 'joined' sequence, depending on the feature table. If
           this option is set TRUE, then any group of these features will be
           output as a single sequence. If the 'before' and 'after'
           qualifiers have been set, then only the sequence before the first
           feature and after the last feature are added."
  ]

  boolean: featinname [
    additional: "Y"
    default: "N"
    information: "Append type of feature to output sequence
                  name"
    help: "To aid you in identifying the type of feature that has been
           output, the type of feature is added to the start of the
           description of the output sequence. Sometimes the description of a
           sequence is lost in subsequent processing of the sequences file,
           so it is useful for the type to be a part of the sequence ID name.
           If you set this to be TRUE then the name is added to the ID name
           of the output sequence."
  ]

  string: describe [
    additional: "Y"
    default: ""
    information: "Feature tag names to add to the description"
    help: "To aid you in identifying some further properties of a
           feature that has been output, this lets you specify one or more
           tag names that should be added to the output sequence Description
           text, together with their values (if any). For example, if this is
           set to be 'gene', then if any output feature has the tag (for
           example) '/gene=BRCA1' associated with it, then the text
           '(gene=BRCA1)' will be added to the Description line. Tags are the
           types of extra values that a feature may have. For example in the
           EMBL feature table, a 'CDS' type of feature may have the tags
           '/codon', '/codon_start', '/db_xref', '/EC_number', '/evidence',
           '/exception', '/function', '/gene', '/label', '/map', '/note',
           '/number', '/partial', '/product', '/protein_id', '/pseudo',
           '/standard_name', '/translation', '/transl_except',
           '/transl_table', or '/usedin'. Some of these tags also have
           values, for example '/gene' can have the value of the gene name. \
           By default no feature tag is displayed. You can set this to match
           any feature tag you wish to show. \
           The tag may be wildcarded by using '*'. \
           If you wish to extract more than one tag, separate their names
           with the character '|', eg: \
           gene | label"
    knowntype: "feature tag list"
  ]

  seqout: outseq [
    parameter: "Y"
  ]

endsection: output
