# Modified by FOG 27.06.2009
# start, stop added
# type INT for start, stop added
# acc parsing changed
# a lot of stuff removed
# IFNOTSET added

AUTODETECT      "LOCUS       s*\nORIGIN*"
KEYWIDTH        12
FILETAG         RDP

BEGIN           "LOCUS*"

MATCH           "LOCUS *"
                SRT             "* *=*1"
                WRITE           "name"

MATCH           "LOCUS *"
                SRT             "* *=*1"
                TAG             "RDP"
                WRITE           "id"

#MATCH           "LOCUS *"
#                SRT             "     = :    = :   = :  = :* * *=*2"
#                TAG             "RDP"
#                WRITE           "db_nuc"

MATCH           "LOCUS *"
                SRT             "     = :    = :   = :  = :* * * * * * *=*7"
                TAG             "RDP"
                WRITE           "date"

MATCH           "DEFINITION *"
                TAG             "RDP"
                WRITE           "description"

MATCH           "COMMENT*Genbank*"
                SRT             "*Genbank\: *=*2:|*=:(*=:;=:not submitted="
                ACI             "extract_words("0123456789",4.0)"
                WRITE           "acc"

#MATCH           "COMMENT*Genbank*"
#                SRT             "*Genbank\: *=*2:|*=:(*=:;=:not submitted="
#                ACI             "extract_words("0123456789",4.0)"
#                WRITE           "db_acc"

#MATCH           "VERSION *"
#                TAG             "RDP"
#                WRITE           "version"

MATCH           "KEYWORDS"
 #               TAG             "RDP"
                WRITE           "keywd_RDP"

#MATCH           "SOURCE *"
#                TAG             "RDP"
#                WRITE           "source"

MATCH           "  ORGANISM *"
#                TAG             "RDP"
                SRT             "*|*=*1"
                WRITE           "tax_rdp_name"

MATCH           "  ORGANISM *"
#                TAG             "RDP"
                SRT             "*|*=*2"
                WRITE           "tax_rdp"

MATCH           "  ORGANISM *"
                SRT             "* * *=*1 *2:*|*=*1"
                WRITE           "full_name"

MATCH           "REFERENCE *"
                SRT             "* *=*1"
                SETVAR          x
                IFNOTSET        x "No REFERENCE entry seen"
#                TAG             "RDP"
#                APPEND          "num_bib"

MATCH           "REFERENCE *"
                SRT             "(=:)=:?*=(?)*"
#                TAG             "RDP"
                APPEND          "nuc_rp"

MATCH           "  AUTHORS *"
                SRT             "*=($x)\: *"
#                TAG             "RDP"
                APPEND          "author"

MATCH           "  TITLE *"
                SRT             "*=($x)\: *"
#                TAG             "RDP"
                APPEND          "title"

MATCH           "  JOURNAL *"
                SRT             "*=($x)\: *"
#                TAG             "RDP"
                APPEND          "journal"

#MATCH           "  MEDLINE *"
#                SRT             "*=($x)\: *"
#                TAG             "RDP"
#                APPEND          "medline_id"

MATCH           "     source*cell_line*"
                SRT             "*/cell_line\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "cell_line"

MATCH           "     source*cell_type*"
                SRT             "*/cell_type\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "cell_type

MATCH           "     source*cultivar*"
                SRT             "*/cultivar\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "cultivar"

MATCH           "     source*db_xref*"
                SRT             "*/db_xref\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "tax_xref_embl"

MATCH           "     source*isolate*"
                SRT             "*/isolate\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "isolate"

MATCH           "     source*isolation_source*"
                SRT             "*/isolation_source\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "isolation_source"

MATCH           "     source*clone*"
                SRT             "*/clone\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "clone"

MATCH           "     source*map*"
                SRT             "*/map\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "map"

MATCH           "     source*organelle*"
                SRT             "*/organelle\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "organelle"

MATCH           "     source*plasmid*"
                SRT             "*/plasmid\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "plasmid"

MATCH           "     source*sero_type*"
                SRT             "*/sero_type\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "serotype"

MATCH           "     source*sero_var*"
                SRT             "*/sero_var\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "serovar"

MATCH           "     source*specimen_voucher*"
                SRT             "*/specimen_voucher\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "voucher"

MATCH           "     source*specific_host*"
                SRT             "*/specific_host\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "host"

MATCH           "     source*strain=*"
#                TAG             "RDP"
                SRT             "*strain\=\"*\"*=*2"
                WRITE           "strain"

MATCH           "     source*sub_species=*"
                TAG             "RDP"
                SRT             "*sub_species\=\"*\"*=*2"
                WRITE           "subspec"

MATCH           "     source*sub_strain=*"
                TAG             "RDP"
                SRT             "*sub_strain\=\"*\"*=*2"
                WRITE           "substrain"

MATCH           "     source*tissue_type=*"
                TAG             "RDP"
                SRT             "*tissue_type\=\"*\"*=*2"
                WRITE           "tissue"

MATCH           "     source*note*"
                SRT             "*/note\=\"*\"*=*2"
                TAG             "RDP"
                WRITE           "note"

MATCH           "     rRNA*db_xref*"
                SRT             "*/db_xref\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "tax_xref_embl"

MATCH           "     rRNA*evidence*"
                SRT             "*/evidence\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "evidence"

MATCH           "     rRNA*allele*"
                SRT             "*/allele\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "allele"

MATCH           "     rRNA*function*"
                SRT             "*/function\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "function"

MATCH           "     rRNA*citation*"
                SRT             "*/citation\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "citation"

MATCH           "     rRNA*gene*"
                SRT             "*/gene\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "gene"

MATCH           "     rRNA*map*"
                SRT             "*/map\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "map"

MATCH           "     rRNA*note*"
                SRT             "*/note\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "note"

MATCH           "     rRNA*operon*"
                SRT             "*/operon\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "operon"

MATCH           "     rRNA*product*"
                SRT             "*/product\=\"*\"*=*2"
                TAG             "RDP"
                APPEND          "product"

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

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

SEQUENCEAFTER   "ORIGIN*"
SEQUENCESRT     " =:~=.:*Check*..="
SEQUENCEACI     "remove("0123456789 /")"
SEQUENCECOLUMN  0
SEQUENCEEND     "//"
CREATE_ACC_FROM_SEQUENCE

END             "//"
