Contents
  1. SnapGene GFF3 Import Specification
  2. Special Type Column Values
  3. About the Example Files


1. SnapGene GFF3 Import Specification
=====================================

GFF3 file must start with:

##gff-version 3
  or
##gff-version 3.
  or
##sequence-region <region-name> <region-start> <region-end>

<region-start> >= 1
<region-end> <= sequence length

SnapGene skips blank lines.

If the following is encountered, no further processing will take place.
##FASTA

All other GFF3 pragmas (lines starting with ##) are ignored.

Comment lines are skipped (lines starting with #).

Must have 8 or 9 columns, each separated by a tab (\t) character.
Otherwise, "Sorry, SnapGene doesn't understand the format of file myfile.gff3."

Column 1: seqid
Sequence identifier

Two forms allowed

Form 1: Same seqid for every feature line
Form 2: Same seqid prefix followed by dash (-) or underscore (_) followed by
        consecutive numbering, one per feature line.
        Leading zeroes are okay and will be ignored.
        seq_00001
        seq_00002

        seq-0001
        seq-0002

        seq-1
        seq-2

Multi-sequence files not currently supported.

seqA
seqA
seqA
seqB
seqB

Column 2: source
Name of software program or service that generated the file.
If none or unknown, just place a dot (.).
SnapGene reads, but ignores, the value in this column.

Column 3: type
Genbank DNA type name or "region" for protein sequence
See section "2. Special Type Column Values" later in this file for more.

Columns 4 and 5: start end
Start and end locations of the feature

If ##sequence-region was specified

  Start >= <region-start>
  End   <= <region-end>

If ##sequence-region was not specified

  Start >= 1
  End   <= sequence length

For a circular sequence, features can wrap around.
Therefore, end can be larger than start so long as
end - start + 1 <= sequence length

Column 6: score
A dot (.) or a floating-point number.

Column 7: directionality
Forward directional (+), reverse directional (-),
non-directional (.), or unknown directionality (?)

Column 8: phase
For a coding sequence (type equals "CDS"), specify 0, 1, or 2.
For a non-coding sequence, specify a dot (.).

SnapGene tolerates a dot in lieu of 0, 1, or 2 for a CDS feature.
In that case, the phase will be treated as though 0 was specified.

  Phase  Directionality  Resulting Reading Frame
  0      forward (+)     +1
  1      forward (+)     +2
  2      forward (+)     +3
  0      reverse (-)     -1
  1      reverse (-)     -2
  2      reverse (-)     -3

Column 9: attributes
If not specified for a given feature line, the feature will import
with a feature name of "Feature N" where N is the next available feature
number starting with 1.

Attributes are separated by a semicolon (;).
Attributes are of one of the following forms:

Form 1: single key/value pair
  key=value

Form 2: single key/multiple values
  key=value1,value2
  key=value1,value2,value3
  etc

If no key/value pairs are specified, SnapGene will treat this column
has containing the feature name.

  My named feature

Special attribute keys:

  color: While not a pre-defined GFF3 attribute key, you can tell
         SnapGene what color to make a feature.

         Format 1: Hex codes (#RRGGBB)

         Where RR, GG, BB are the amounts of red, green, and blue, respectively
         to include in the color. Each value is a hex value from 00 through FF.

         Example: white
           #FFFFFF

         Example: pure red
           #FF0000

         Example: 50% gray
           #7F7F7F

         Format 2: Decimal codes (R,G,B)

         Where R, G, B are the amounts of red, green, and blue, respectively
         to include in the color. Each value is an integer from 0 through 255.

         Example: white
           255,255,255

         Example: pure red
           255,0,0

         Example: 50% gray
           127,127,127

  Dbxref: Database cross-reference
          Has the form: dbName:dbValue

          dbName must equal a database name that SnapGene recognizes.
          To see the list, in SnapGene, add or edit a misc_feature
          and create a /db_xref qualifier.

          SnapGene create a /db_xref qualifier

          For convenience, here's the current list:
            AceView/WormGenes
            AFTOL
            AntWeb
            APHIDBASE
            ApiDB
            ApiDB_CryptoDB
            ApiDB_PlasmoDB
            ApiDB_ToxoDB
            Araport
            ASAP
            ATCC
            ATCC(in host)
            ATCC(dna)
            Axeldb
            BDGP_EST
            BDGP_INS
            BEEBASE
            BEETLEBASE
            BEI
            BGD
            BOLD
            CABRI
            CCAP
            CDD
            CGD
            dbEST
            dbProbe
            dbSNP
            dbSTS
            dictyBase
            EcoGene
            ECOCYC
            ENSEMBL
            EnsemblGenomes
            EPD
            ERIC
            ESTLIB
            FANTOM_DB
            FBOL
            FLYBASE
            Fungorum
            GABI
            GDB
            GeneDB
            GeneID
            GI
            GO
            GOA
            Greengenes
            GRIN
            HGNC
            H-InvDB
            HMP
            HOMD
            HPM
            HSSP
            IKMC
            IMGT/GENE-DB
            IMGT/LIGM
            IMGT/HLA
            InterPro
            IntrepidBio
            IRD
            ISD
            ISFinder
            ISHAM-ITS
            JCM
            JGIDB
            JGI's Phytozome
            LocusID
            MaizeGDB
            MarpolBase
            MedGen
            MGI
            MIM
            miRBase
            MycoBank
            NBRC
            NextDB
            niaEST
            NMPDR
            NRESTdb
            OrthoMCL
            Osa1
            Pathema
            PBmice
            PDB
            PFAM
            PGN
            PIR
            PomBase
            PSEUDO
            PseudoCap
            RAP-DB
            RATMAP
            RBGE_garden
            RBGE_herbarium
            RFAM
            RGD
            RiceGenes
            RNAcentral
            RZPD
            SEED
            SGD
            SK-FST
            SoyBase
            SRPDB
            SubtiList
            taxon
            The Arabidopsis IR
            TIGRFAM
            TubercuList
            UNILIB
            UniProtKB/Swiss-Prot
            UniProtKB/TrEMBL
            UniSTS
            UNITE
            VBASE2
            VectorBase
            VGNC
            ViPR
            WorfDB
            WormBase
            Xenbase
            ZFIN

  ID or Id: feature lines that share the same ID are part of the same feature

  Name: feature name that SnapGene will display

        If missing, the value of the ID attribute will be the feature name

        If no key/value pairs are specified, SnapGene will treat the 9th column
        has containing the feature name.

          My named feature

  Note: SnapGene will create a /note qualifier that contains value.

  Parent: This feature line has parent(s).
          Value(s) are a ID of a previously specified feature line.

  gbkey: This feature is a site feature in a protein sequence if
         gbkey=Site

         A single segment site feature may refer to:
           One sequence base, if start and end are the same value, or
           A range of sequence bases, if end > start.

         To specify a multi-segment site:

         gbkey=Site;is_ordered=true;part=1/3
         gbkey=Site;is_ordered=true;part=2/3
         gbkey=Site;is_ordered=true;part=3/3

         where 1/3, 2/3, and 3/3 are the first, second, and third segment, respectively

         Since each segment has its own feature line, you can specify start/end bases
         on a per-segment basis.

Custom attribute keys:

  You can define your own attribute keys (and many third-party programs do).
  The rule is that such keys must begin with a lowercase character.

  SnapGene will add /note qualifiers of the form:
    GFF3 key: value

Unrecognized / unsupported attribute keys:

  The GFF3 specification says that pre-defined key names begin with an uppercase letter.
  Custom attribute key names begin with a lowercase letter.

  If SnapGene doesn't recognize or support a given key, whether pre-defined or custom,
  or comes across an unrecognized key value (e.g., a value for Db_xref that's not
  recognized by SnapGene), if will add /note qualifiers of the form:

    GFF3 key: value

End of column descriptions


2. Special Type Column Values
=============================

If "gene", a gene feature will be imported.

For each child of type "CDS" having the same value of the ID attribute,
a CDS feature will be imported. The feature's directionality will be
the same as the first encountered feature line in the feature.
Gap segments will automatically be included that span neighboring,
non-contiguous base ranges.

Each child of type "mRNA" or "prim_transcript" having a unique value of the ID attribute
is imported as an mRNA transcript or prim_transcript, respectively. If the feature line
has "exon" children, the mRNA feature will be multi-segmented. Gap segments will automatically
be included that span neighboring, non-contiguous base ranges.

For each child of the mRNA of type "CDS" having the same value of the ID attribute,
a CDS feature will be imported. The feature's directionality will be
the same as the first encountered feature line in the feature.
Gap segments will automatically be included that span neighboring,
non-contiguous base ranges.

If the mRNA has a 5'UTR child or 3'UTR child or both, a feature will be imported
for each such child.

Each child of type "misc_feature" gets its own feature.


3. About the Example Files
==========================
To import these example files:
  For a DNA sequence, you'll need to create/open a 10kbp sequence.
  For a protein sequence, you'll need to create/open a 100aa sequence.

colors.gff3: shows both ways to manually specify feature colors

feature_name_four_ways.gff3: all the ways to specify a feature name

    First way:  Specify a value of the Name attribute
    Second way: Specify a value of the ID attribute
    Third way:  Specify the feature name in lieu of attributes
    Fourth way: Specify only eight columns (SnapGene will name features "Feature 1", "Feature 2", etc.

gene.gff3: gene with three child mRNA and four CDS

  EDEN (gene)
    EDEN.1 (mRNA with four exons: exon00002, exon00003, exon00004, exon00005)
    EDEN.2 (mRNA with three exons: exon00002, exon00004, exon00005)
    EDEN.3 (mRNA with four exons: exon00001, exon00003, exon00004, exon00005)
    edenprotein.1 (CDS with four segments)
    edenprotein.2 (CDS with three segments)
    edenprotein.3 (CDS with three segments)
    edenprotein.4 (CDS with three segments)

protein_features.gff3: contains a region feature and different examples of site features

seqid_way_1_good.gff3, seqid_way_2_good.gff3, seqid_way_3_bad.gff3

    First way: Seq id (first column) value is the same throughout.
               This is the most common way.
    Second way: Seq id has _# or -# appended, where # increases by one for each subsequent line.
                We encountered such a file from a customer, but it's not standard.
    Third way: Multi-sequence file. Someday SnapGene may support this, but not now.
               SnapGene will report "Sorry, SnapGene doesn't currently support importing multi-sequence feature files."

