<ol>
<li><p>That is a GenBank gene ID and it (<a href="https://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html" rel="nofollow noreferrer">apparently</a>) stands for &quot;GenInfo Identifier&quot;. The full GenBank ID is <code>gi|61393989</code>.</p>
</li>
<li><p>Yes, this is the standard format for sequences provided by NCBI. However, you can have all sorts of extra details appended to that. They (NCBI) generally use <code>|</code> as a field separator, so you could try to write code that parse that, but I really wouldn't recommend it. The FASTA headers have traditionally been free. People can put anything they like there apart from a <code>\n</code>, so I really wouldn't put any effort into writing code to parse these headers.</p>
<p>If you need a short name for the sequence, just take the first N characters or, if it matches <code>^..|.+?|</code>, take the characters until the second <code>|</code>. Seriously though, don't bother parsing this it is very rarely helpful and is almost certain to break as soon as you use a different database.</p>
</li>
<li><p>The AY848686.1 is a GenBank accession. The <code>gb</code> indicates that it's a GenBank accession and the <code>.1</code> means it is the 1st version of that accession.</p>
</li>
</ol>
<p>As for why there are two (<a href="https://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html" rel="nofollow noreferrer">source</a>):</p>
<blockquote>
<p>Unlike the gi number system, in which sequence identification numbers were not necessarily consistent across the databases (e.g., GenBank and EMBL could each assign their own gi number to a sequence), the new system is designed to ensure consistency. It is also designed to show a relationship between a sequence identification number and the accession number of the record in which it is found. In contrast, GI numbers are assigned consecutively and bear no resemblance to the accession number. Finally, the new system allows the assignment of alphanumeric protein IDs to proteins translations within nucleotide sequence records. The protein IDs contain three letters followed by five digits, a period, and a version number.</p>
</blockquote>

CC BY-SA 3.0
2017-07-26T17:31:21.397Z
2017-07-26T17:31:21.397Z
2020-06-18T08:30:41.743Z
terdon
<ol>
<li>The <code>gi</code> is an abbreviation for "Genbank identifier".</li>
<li>This is a pretty standard convention used by data stored in NCBI databases. There used to be a pretty comprehensive description of the conventions used at NCBI (I wouldn't say it was a standard or specification, just convention) <a href="ftp://ftp.ncbi.nih.gov/blast/documents/formatdb.html" rel="nofollow noreferrer">here</a>, but this page is no longer available it seems.</li>
<li>The <code>AY848686</code> label is an accession value, and the appended number is a version number.</li>
</ol>

<p>See <a href="https://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html" rel="nofollow noreferrer">this page</a> for more info.</p>

<p>The short answer is: these are all internal conventions. None of it <em>needs</em> to be there, except perhaps to ensure NCBI's internal tools work as expected.</p>

<hr>

<p><strong>UPDATE</strong>: I found a non-official copy of the old docs <a href="http://structure.usc.edu/blast/formatdb.html" rel="nofollow noreferrer">here</a>. Look for the section starting with "FASTA Defline Format". I've copied it here to prevent further problems with bitrot in the future.</p>

<pre><code>FASTA Defline Format
--------------------
The syntax of FASTA Deflines used by the NCBI BLAST server depends on
the database from which each sequence was obtained.  The table below lists
the identifiers for the databases from which the sequences were derived.


  Database Name                         Identifier Syntax

  GenBank                               gb|accession|locus
  EMBL Data Library                     emb|accession|locus
  DDBJ, DNA Database of Japan           dbj|accession|locus
  NBRF PIR                              pir||entry
  Protein Research Foundation           prf||name
  SWISS-PROT                            sp|accession|entry name
  Brookhaven Protein Data Bank          pdb|entry|chain
  Patents                               pat|country|number 
  GenInfo Backbone Id                   bbs|number 
  General database identifier           gnl|database|identifier
  NCBI Reference Sequence               ref|accession|locus
  Local Sequence identifier             lcl|identifier


For example, an identifier might be "gb|M73307|AGMA13GT", where the "gb" tag
indicates that the identifier refers to a GenBank sequence, "M73307" is its
GenBank ACCESSION, and "AGMA13GT" is the GenBank LOCUS.  

"gi" identifiers are being assigned by NCBI for all sequences contained
within NCBI's sequence databases.  The 'gi' identifier provides a uniform
and stable naming convention whereby a specific sequence is assigned
its unique gi identifier.  If a nucleotide or protein sequence changes,
however, a new gi identifier is assigned, even if the accession number
of the record remains unchanged. Thus gi identifiers provide a mechanism
for identifying the exact sequence that was used or retrieved in a
given search.

For searches of the nr protein database where the sequences are derived
from conceptual translations of sequences from the nucleotide databases
the following syntax is used:

                     gi|gi_identifier

An example would be:

        gi|451623           (U04987) env [Simian immunodeficiency..."

where '451623' is the gi identifier and the 'U04987' is the accession
number of the nucleotide sequence from which it was derived.

Users are encouraged to use the '-I' option for Blast output which will
produce a header line with the gi identifier concatenated with the database
identifier of the database from which it was derived, for example, from a
nucleotide database:

        gi|176485|gb|M73307|AGMA13GT

And similarly for protein databases: 

        gi|129295|sp|P01013|OVAX_CHICK

The gnl ('general') identifier allows databases not on the above list to
be identified with the same syntax.  An example here is the PID identifier:

        gnl|PID|e1632

PID stands for Protein-ID; the "e" (in e1632) indicates that this ID
was issued by EMBL.  As mentioned above, use of the "-I" option
produces the NCBI gi (in addition to the PID) which users can also
retrieve on.

The bar ("|") separates different fields as listed in the above table.
In some cases a field is left empty, even though the original
specification called for including this field.  To make
these identifiers backwards-compatiable for older parsers
the empty field is denoted by an additional bar ("||").
</code></pre>

CC BY-SA 3.0
2017-07-26T17:31:03.807Z
Thanks for the quick and accurate answer. As a follow up question- is there some reason why NCBI has accession numbers as well as an ID numbers?
Jon Deaton
CC BY-SA 3.0
2017-07-26T17:33:03.213Z
@JonDeaton history, mostly. The GIs are far older. Also see the "Historical Note" section in the link Daniel gave you.
terdon
CC BY-SA 3.0
2017-07-27T07:31:33.170Z
@JonDeaton For parsing be aware that NCBI have phased out GI numbers from fasta headers since Sept 2016. I couldnt find a new source for this info but please see this note from their blog https://ncbiinsights.ncbi.nlm.nih.gov/2016/07/15/ncbi-is-phasing-out-sequence-gis-heres-what-you-need-to-know/
AudileF
CC BY-SA 3.0
2017-07-26T17:25:01.930Z
2017-07-26T17:33:05.717Z
2017-07-26T17:33:05.717Z
Daniel Standage
<p>I have been analyzing some virus DNA from the NCBI databases. The fasta sequences that I recieve from them have header lines that look like this:</p>

<pre><code>&gt;gi|61393989|gb|AY848686.1|
</code></pre>

<p>I think that the second number is the GenBank ID, but I have several questions:</p>

<p>1) What does the "gi" in the first ID stand for?</p>

<p>2) Is this a standard format for storing a series of IDs associated with sequences? That is, should I expect to see this format elsewhere and be prepared to parse fasta headers like this in code that I write?</p>

<p>3) It seems that <code>AY848686</code> is also a valid GenBank ID, and I see the <code>.1</code> missing/present in GenBank IDs in various places. What does the <code>.1</code> mean at the end of GenBank IDs and why is it there/does it <em>need</em> to be there?</p>

<p>Thanks in advance for you answers.</p>

<fasta><identifiers>
Fasta Sequence Identifier format?
# Fasta Sequence Identifier format?

(Asked by: username_0 on 2017-07-26)

I have been analyzing some virus DNA from the NCBI databases. The fasta sequences that I recieve from them have header lines that look like this:
>gi|61393989|gb|AY848686.1|

I think that the second number is the GenBank ID, but I have several questions:
1) What does the "gi" in the first ID stand for?
2) Is this a standard format for storing a series of IDs associated with sequences? That is, should I expect to see this format elsewhere and be prepared to parse fasta headers like this in code that I write?
3) It seems that AY848686 is also a valid GenBank ID, and I see the .1 missing/present in GenBank IDs in various places. What does the .1 mean at the end of GenBank IDs and why is it there/does it need to be there?
Thanks in advance for you answers.

**Tags:** fasta, identifiers

---

## 2 answers

### Answer by username_2 on 2017-07-26. Score: 5 | Accepted answer

The gi is an abbreviation for "Genbank identifier".
This is a pretty standard convention used by data stored in NCBI databases. There used to be a pretty comprehensive description of the conventions used at NCBI (I wouldn't say it was a standard or specification, just convention) here, but this page is no longer available it seems.
The AY848686 label is an accession value, and the appended number is a version number.

See this page for more info.
The short answer is: these are all internal conventions. None of it needs to be there, except perhaps to ensure NCBI's internal tools work as expected.

UPDATE: I found a non-official copy of the old docs here. Look for the section starting with "FASTA Defline Format". I've copied it here to prevent further problems with bitrot in the future.
FASTA Defline Format
--------------------
The syntax of FASTA Deflines used by the NCBI BLAST server depends on
the database from which each sequence was obtained.  The table below lists
the identifiers for the databases from which the sequences were derived.


  Database Name                         Identifier Syntax

  GenBank                               gb|accession|locus
  EMBL Data Library                     emb|accession|locus
  DDBJ, DNA Database of Japan           dbj|accession|locus
  NBRF PIR                              pir||entry
  Protein Research Foundation           prf||name
  SWISS-PROT                            sp|accession|entry name
  Brookhaven Protein Data Bank          pdb|entry|chain
  Patents                               pat|country|number 
  GenInfo Backbone Id                   bbs|number 
  General database identifier           gnl|database|identifier
  NCBI Reference Sequence               ref|accession|locus
  Local Sequence identifier             lcl|identifier


For example, an identifier might be "gb|M73307|AGMA13GT", where the "gb" tag
indicates that the identifier refers to a GenBank sequence, "M73307" is its
GenBank ACCESSION, and "AGMA13GT" is the GenBank LOCUS.  

"gi" identifiers are being assigned by NCBI for all sequences contained
within NCBI's sequence databases.  The 'gi' identifier provides a uniform
and stable naming convention whereby a specific sequence is assigned
its unique gi identifier.  If a nucleotide or protein sequence changes,
however, a new gi identifier is assigned, even if the accession number
of the record remains unchanged. Thus gi identifiers provide a mechanism
for identifying the exact sequence that was used or retrieved in a
given search.

For searches of the nr protein database where the sequences are derived
from conceptual translations of sequences from the nucleotide databases
the following syntax is used:

                     gi|gi_identifier

An example would be:

        gi|451623           (U04987) env [Simian immunodeficiency..."

where '451623' is the gi identifier and the 'U04987' is the accession
number of the nucleotide sequence from which it was derived.

Users are encouraged to use the '-I' option for Blast output which will
produce a header line with the gi identifier concatenated with the database
identifier of the database from which it was derived, for example, from a
nucleotide database:

        gi|176485|gb|M73307|AGMA13GT

And similarly for protein databases: 

        gi|129295|sp|P01013|OVAX_CHICK

The gnl ('general') identifier allows databases not on the above list to
be identified with the same syntax.  An example here is the PID identifier:

        gnl|PID|e1632

PID stands for Protein-ID; the "e" (in e1632) indicates that this ID
was issued by EMBL.  As mentioned above, use of the "-I" option
produces the NCBI gi (in addition to the PID) which users can also
retrieve on.

The bar ("|") separates different fields as listed in the above table.
In some cases a field is left empty, even though the original
specification called for including this field.  To make
these identifiers backwards-compatiable for older parsers
the empty field is denoted by an additional bar ("||").

> **Comments:**
> **username_0**: Thanks for the quick and accurate answer. As a follow up question- is there some reason why NCBI has accession numbers as well as an ID numbers?  
> **username_1**: @JonDeaton history, mostly. The GIs are far older. Also see the "Historical Note" section in the link Daniel gave you.  
> **username_3**: @JonDeaton For parsing be aware that NCBI have phased out GI numbers from fasta headers since Sept 2016. I couldnt find a new source for this info but please see this note from their blog https://ncbiinsights.ncbi.nlm.nih.gov/2016/07/15/ncbi-is-phasing-out-sequence-gis-heres-what-you-need-to-know/  

---

### Answer by username_1 on 2017-07-26. Score: 1

1. That is a GenBank gene ID and it ([apparently](https://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html)) stands for "GenInfo Identifier". The full GenBank ID is `gi|61393989`.
2. Yes, this is the standard format for sequences provided by NCBI. However, you can have all sorts of extra details appended to that. They (NCBI) generally use `|` as a field separator, so you could try to write code that parse that, but I really wouldn't recommend it. The FASTA headers have traditionally been free. People can put anything they like there apart from a `\n`, so I really wouldn't put any effort into writing code to parse these headers.

   If you need a short name for the sequence, just take the first N characters or, if it matches `^..|.+?|`, take the characters until the second `|`. Seriously though, don't bother parsing this it is very rarely helpful and is almost certain to break as soon as you use a different database.
3. The AY848686.1 is a GenBank accession. The `gb` indicates that it's a GenBank accession and the `.1` means it is the 1st version of that accession.

As for why there are two ([source](https://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html)):

> Unlike the gi number system, in which sequence identification numbers were not necessarily consistent across the databases (e.g., GenBank and EMBL could each assign their own gi number to a sequence), the new system is designed to ensure consistency. It is also designed to show a relationship between a sequence identification number and the accession number of the record in which it is found. In contrast, GI numbers are assigned consecutively and bear no resemblance to the accession number. Finally, the new system allows the assignment of alphanumeric protein IDs to proteins translations within nucleotide sequence records. The protein IDs contain three letters followed by five digits, a period, and a version number.


---

