application: extractfeat [
  documentation: "Extract features from sequence(s)"
  groups: "Edit, Feature tables"
    relations: "EDAM_topic:0160 Sequence sites and features"
    relations: "EDAM_topic:0091 Data handling"
    relations: "EDAM_operation:2422 Data retrieval"
]

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

  seqall: sequence [
    parameter: "Y"
    type: "any"
    features: "Y"
    relations: "EDAM_data:0849 Sequence record"
  ]

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."
    relations: "EDAM_data:1249 Sequence length"
  ]

  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."
    relations: "EDAM_data:1249 Sequence length"
  ]

  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"
    relations: "EDAM_data:0856 Sequence feature source"
  ]

  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://www.ebi.ac.uk/embl/WebFeat/ for a list of the EMBL
           feature types and see the Uniprot user manual in
           http://www.uniprot.org/manual/sequence_annotation
           for a list of the Uniprot 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"
    relations: "EDAM_data:1020 Sequence feature key"
  ]

  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"
    relations: "EDAM_data:0853 DNA sense specification"
  ]

  float: minscore [
    additional: "Y"
    default: "0.0"
    information: "Minimum score of feature to extract"
    help: "Minimum score of feature to extract (see also maxscore)"
    relations: "EDAM_data:1772 Score or penalty"
  ]

  float: maxscore [
    additional: "Y"
    default: "0.0"
    information: "Maximum score of feature to extract"
    help: "Maximum score of feature to extract. \
           If both minscore and maxscore are zero (the default),
           then any score is ignored"
    relations: "EDAM_data:1772 Score or penalty"
  ]

  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"
    relations: "EDAM_data:1021 Sequence feature qualifier"
  ]

  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 value you 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"
    relations: "EDAM_data:1021 Sequence feature qualifier"
  ]

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."
    relations: "EDAM_data:2527 Parameter"
  ]

  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."
    relations: "EDAM_data:2527 Parameter"
  ]

  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"
    relations: "EDAM_data:1021 Sequence feature qualifier"
  ]

  seqout: outseq [
    parameter: "Y"
    relations: "EDAM_data:0849 Sequence record"
  ]

endsection: output
