#Modified by FOG, 17.05.2009#
#type INT for start, stop and insdc added#
#some changes to fields#

AUTODETECT      "LOCUS       *\nORIGIN*"
                #Global settings:
KEYWIDTH        12
FILETAG         GB

BEGIN           "LOCUS*"

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

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

MATCH           "ACCESSION *"
                ACI "extract_words("0123456789",4.0)"
                WRITE "acc"

MATCH           "PROJECT"
                WRITE_INT "insdc"

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

MATCH           "DEFINITION"
                TAG             "GB"
                WRITE "description"

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

MATCH           "  ORGANISM *"
                SRT             "*|*=*2"
                TAG    "GB"
                WRITE           "tax_embl"

MATCH           "  ORGANISM *"
                SRT             "* * *=*1 *2:*|*=*1"
                TAG   "GB"
                WRITE           "tax_embl_name"

MATCH           "REFERENCE *(bases*"
                SRT             "*(*=*2:bases=:to=-: =:)="
                APPEND          "nuc_rp"

MATCH           "   PUBMED *"
                APPEND          "pubmed_id"
                
MATCH           "  AUTHORS *"
                APPEND "author"

MATCH           "  TITLE *"
                APPEND          "title"

MATCH           "  JOURNAL *"
                APPEND          "journal"

MATCH           "  JOURNAL *Submitted*"
                SRT "*Submitted*=*2:\(*\)*=*1"
                WRITE           "submit_date"

MATCH           "     source*"
                SRT "*source*=*2: =:*|*=*1"
                WRITE           "nuc_region"

MATCH           "*/clone*"
                SRT "*clone*=*2:\"=:\==:*|*=*1"
                APPEND          "clone"

MATCH           "*/db_xref="taxon*"
                SRT "*db_xref*=*2:*\:*=*2:\"=:\==:*|*=*1"
                TAG   "GB"
                APPEND          "tax_xref_embl"

MATCH           "*/isolate=*"
                SRT "*isolate*=*2:\"=:\==:*|*=*1"
                APPEND          "isolate"

MATCH           "*/strain*"
                SRT             "*/strain*=*2:\"=:\==:*|*=*1"
                APPEND          "strain"

MATCH           "*/isolation_source*"
                SRT             "*/isolation_source*=*2:\"=:\==:*|*=*1"
                APPEND          "isolation_source"

MATCH           "*/country*"
                SRT             "*/country*=*2:\"=:\==:*|*=*1"
                APPEND          "country"

MATCH           "*/lat_lon*"
                SRT             "*/lat_lon*=*2:\"=:\==:*|*=*1"
                APPEND          "lat_lon"

MATCH           "*/specimen_voucher*"
                SRT             "*/specimen_voucher*=*2:\"=:\==:*|*=*1"
                APPEND          "specimen_voucher"

MATCH           "*/specific_host*"
                SRT             "*/specific_host*=*2:\"=:\==:*|*=*1"
                APPEND          "specific_host"

MATCH           "*/collected_by*"
                SRT             "*/collected_by*=*2:\"=:\==:*|*=*1"
                APPEND          "collected_by"

MATCH           "*/collection_date*"
                SRT             "*/collection_date*=*2:\"=:\==:*|*=*1"
                APPEND          "collection_date"

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

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

MATCH           "     rRNA*/gene*"
                SRT             "*gene*=*2:\==:"=:*|*=*1"
                APPEND          "gene" 

MATCH           "     rRNA*/product*"
                SRT             "*product*=*2:\==:"=:*|*=*1"
                APPEND          "product" 

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

END             "//"
