# This file is no complete import-filter.
# It is included from longgenbank.ift and longebi.ift
#
# includer has to
# set 't' to 'GB' or 'EBI'    (used for tags)
# set 'u' to 'gb' or 'embl'   (used as field name suffix)

IFNOTSET t "feature_table.ift expects SETGLOBAL 't'"
IFNOTSET u "feature_table.ift expects SETGLOBAL 'u'"

# for debugging purposes you may like to uncomment the next line (see also EOF)
# AUTOTAG "ft"

MATCH           "FT   source*"
                SRT             "*source*=*2: ="
#                TAG             "$t"
                APPEND          "nuc_region"

MATCH           "FTx  source *mol_type*"
                SRT             "*mol_type*=*2:\==:\"=:"
#                TAG             "$t"
                APPEND          "mol_type"

MATCH           "FTx  source *citation*"
                SRT             "*citation*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "biblio"

MATCH           "FTx source *cell_line*"
                SRT             "*cell_line*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "cell_line"

MATCH           "FTx  source *cell_type*"
                SRT             "*cell_type*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "cell_type"

MATCH           "FTx  source *clone*"
                SRT             "*clone*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "clone"

MATCH           "FTx  source *clone_lib*"
                SRT             "*clone_lib*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "clone_lib"

MATCH           "FTx  source *cultivar*"
                SRT             "*cultivar*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "cultivar"

MATCH           "FTx  source *db_xref=*"
                SRT             "*db_xref*=*2:\"=:\=="
                TAG             "$t"
                APPEND          "xref_1"

MATCH           "FTx  source *db_xref="taxon*"
                SRT             "*db_xref*=*2:*\:*=*2:\"=:\=="
#                TAG             "$t"
#                APPEND          "tax_xref_embl"
#                APPEND          "tax_xref_gb"
                # set tax_xref_embl or tax_xref_gb (see definition in includer)
                APPEND          "tax_xref_$u"

MATCH           "FTx  source *lab_host=*"
                SRT             "*lab_host*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "host"

MATCH           "FTx  source *isolate=*"
                SRT             "*isolate*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "isolate"

MATCH           "FTx  source *strain*"
                SRT             "*/strain*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "strain"

MATCH           "FTx  source *isolation_source*"
                SRT             "*/isolation_source*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "isolation_source"

MATCH           "FTx  source *country*"
                SRT             "*/country*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "country"

MATCH           "FTx  source *map*"
                SRT             "*/map*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "map"

MATCH           "FTx  source *lat_lon*"
                SRT             "*/lat_lon*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "lat_lon"

MATCH           "FTx  source *note*"
                SRT             "*/note*=*2:\"=:\=="
                TAG             "$t"
                APPEND          "note"

MATCH           "FTx  source *organelle*"
                SRT             "*/organelle*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "organelle"

MATCH           "FTx  source *plasmid*"
                SRT             "*/plasmid*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "plasmid"

MATCH           "FTx  source *serotype*"
                SRT             "*/serotype*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "serotype"

MATCH           "FTx  source *serovar*"
                SRT             "*/serovar*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "serovar"

MATCH           "FTx  source *sub_species*"
                SRT             "*/sub_species*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "subspec"

MATCH           "FTx  source *specimen_voucher*"
                SRT             "*/specimen_voucher*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "specimen_voucher"

MATCH           "FTx  source *specific_host*"
                SRT             "*/specific_host*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "specific_host"

MATCH           "FTx  source *tissue_type*"
                SRT             "*/tissue_type*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "tissue"

MATCH           "FTx  source *variety*"
                SRT             "*/variety*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "variety"

MATCH           "FTx  source *collected_by*"
                SRT             "*/collected_by*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "collected_by"

MATCH           "FTx  source *collection_date*"
                SRT             "*/collection_date*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "collection_date"

MATCH           "FT   CDS*"
                SRT             "<=:>=:*CDS*..*=*2: ="
                WRITE_INT       "start"

MATCH           "FT   CDS*"
                SRT             "<=:>=:*CDS*..*=*3: ="
                WRITE_INT       "stop"

MATCH           "FT   CDS*"
                SRT             "<=:>=:*CDS*=*2: ="
                SETVAR          z
                IFNOTSET        z "No CDS location seen"
#                TAG             "$t"
                APPEND          "cds_position"

MATCH           "FTx  CDS *allele*"
                SRT             "*allele*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "allele"

MATCH           "FTx  CDS *citation*"
                SRT             "*citation*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "citation"

MATCH           "FTx  CDS *codon_start*"
                SRT             "*codon_start*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "codon_start"

MATCH           "FTx  CDS *db_xref*"
                SRT             "*db_xref*=*2:\"=:\=="
                TAG             "$t"
                APPEND          "xref_2"

MATCH           "FTx  CDS *function*"
                SRT             "*function*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "function"

MATCH           "FTx  CDS *EC_number*"
                SRT             "*EC_number*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "ec_number"

MATCH           "FTx  CDS *transl_table*"
                SRT             "*transl_table*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "transl_table"

MATCH           "FTx  CDS *gene*"
                SRT             "*gene*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "gene"

MATCH           "FTx  CDS *product*"
                SRT             "*product*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "product"

MATCH           "FTx  CDS *operon*"
                SRT             "*operon*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "operon"

MATCH           "FTx  CDS *protein_id*"
                SRT             "*protein_id*=*2:\"=:\=="
#                TAG             "$t"
                APPEND          "protein_id"

#MATCH          "FTx  CDS *translation*"
#               SRT             "*translation*=*2:\"=:\=="
#               TAG             "$t"
#               APPEND          "translation"

MATCH           "FT   rRNA*"
                SRT             "*rRNA*=*2: =:*..*=*1:<=:>="
                WRITE_INT       "start" 

MATCH           "FT   rRNA *"
                SRT             "*rRNA*=*2: =:*..*=*2:<=:>="
                WRITE_INT       "stop" 

MATCH           "FTx  rRNA *gene*"
                SRT             "*gene*=*2:\==:"="
#                TAG             "$t"
                APPEND          "gene" 

MATCH           "FTx  rRNA *product*"
                SRT             "*product*=*2:\==:"="
#                TAG             "$t"
                APPEND          "product" 

#MATCH          "FT *"
#               SRT             "FT   *=*"
#               APPEND          "ebi_comment"

# AUTOTAG
