Difference between revisions of "FASTA format"

From Christoph's Personal Wiki
Jump to: navigation, search
Line 201: Line 201:
  
 
==See also==
 
==See also==
* [[BLAST]]
+
*[[LFasta]]
* [[Blastall]]
+
*[[BLAST]]
* [[Formatdb]]
+
*[[Blastall]]
 +
*[[Formatdb]]
  
== External links ==
+
==External links==
* [http://en.wikipedia.org/wiki/FASTA_format Wikipedia article on '''FASTA format''']
+
*[http://emboss.sourceforge.net/docs/themes/SequenceFormats.html#in Sequence Formats]
* [http://emboss.sourceforge.net/docs/themes/SequenceFormats.html#in Sequence Formats]
+
*[http://www.ncbi.nlm.nih.gov/blast/fasta.shtml NCBI's FASTA format description]
* [http://www.ncbi.nlm.nih.gov/blast/fasta.shtml NCBI's FASTA format description]
+
*[http://www.binf.ku.dk/~kasper/misc/lfasta/ LFasta]
* [http://www.binf.ku.dk/~kasper/misc/lfasta/ LFasta]
+
*[http://www.cyber-indian.com/bioperl/index.html mGen] — containing four of the world biggest databases GenBank, Refseq, EMBL and DDBJ - easy and simple program friendly gene extraction
* [http://www.cyber-indian.com/bioperl/index.html mGen] — containing four of the world biggest databases GenBank, Refseq, EMBL and DDBJ - easy and simple program friendly gene extraction
+
*[[wikipedia:FASTA_format]]
  
 
[[Category:Bioinformatics]]
 
[[Category:Bioinformatics]]

Revision as of 03:02, 5 August 2007

In bioinformatics, FASTA format is a file format used to exchange information between genetic sequence databases.

A sequence in FASTA format begins with a single-line description, followed by lines of sequence data. The description line is distinguished from the sequence data by a greater-than (">") symbol in the first column. The word following the ">" symbol is the identifier of the sequence, and the rest of the line is the description (both are optional). There should be no space between the ">" and the first letter of the identifier. It is recommended that all lines of text be shorter than 80 characters. The sequence ends if another line starting with a ">" appears; this indicates the start of another sequence. An example FASTA format:

>gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]
LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV
EWIWGGFSVDKATLNRFFAFHFILPFTMVALAGVHLTFLHETGSNNPLGLTSDSDKIPFHPYYTIKDFLG
LLILILLLLLLALLSPDMLGDPDNHMPADPLNTPLHIKPEWYFLFAYAILRSVPNKLGGVLALFLSIVIL
GLMPFLHTSKHRSMMLRPLSQALFWTLTMDLLTLTWIGSQPVEYPYTIIGQMASILYFSIILAFLPIAGX
IENY

Sequences are expected to be represented in the standard IUB/IUPAC amino acid and nucleic acid codes, with these exceptions: lower-case letters are accepted and are mapped into upper-case; a single hyphen or dash can be used to represent a gap character; and in amino acid sequences, U and * are acceptable letters (see below). Before submitting a request, any numerical digits in the query sequence should either be removed or replaced by appropriate letter codes (e.g., N for unknown nucleic acid residue or X for unknown amino acid residue).

The nucleic acid codes supported are:

Nucleic Acid Code Meaning
A Adenosine
C Cytidine
G Guanine
T Thymidine
U Uracil
R G A (puRine)
Y T C (pYrimidine)
K G T (Ketone)
M A C (aMino group)
S G C (Strong interaction)
W A T (Weak interaction)
B G T C (not A) (B comes after A)
D G A T (not C) (D comes after C)
H A C T (not G) (H comes after G)
V G C A (not T, not U) (V comes after U)
N A G C T (aNy)
- gap of indeterminate length

The amino acid codes supported are:

Amino Acid Code Meaning
A Alanine
B Aspartic acid or Asparagine
C Cysteine
D Aspartate
E Glutamate
F Phenylalanine
G Glycine
H Histidine
I Isoleucine
K Lysine
L Leucine
M Methionine
N Asparagine
P Proline
Q Glutamine
R Arginine
S Serine
T Threonine
U Selenocysteine
V Valine
W Tryptophan
Y Tyrosine
Z Glutamate or Glutamine
X any
* translation stop
- gap of indeterminate length

Syntax

A FASTA format looks like the following:

>SEQUENCE_1
;comment line 1 (optional)
MTEITAAMVKELRESTGAGMMDCKNALSETNGDFDKAVQLLREKGLGKAAKKADRLAAEG
LVSVKVSDDFTIAAMRPSYLSYEDLDMTFVENEYKALVAELEKENEERRRLKDPNKPEHK
IPQFASRKQLSDAILKEAEEKIKEELKAQGKPEKIWDNIIPGKMNSFIADNSQLDSKLTL
MGQFYVMDDKKTVEQVIAEKEKEFGGKIKIVEFICFEVGEGLEKKTEDFAAEVAAQL
>SEQUENCE_2
;comment line 1 (optional)
;comment line 2 (optional)
SATVSEINSETDFVAKNDQFIALTKDTTAHIQSNSLQSVEELHSSTINGVKFEEYLKSQI
ATIGENLVVRRFATLKAGANGVVNGYIHTNGRVGVVIAAACDSAEVASKSRDLLRQICMH

It consists of a header line (beginning with a '>') which gives a name and/or a unique identifier for the sequence, and often lots of other information too. Many different sequence databases use standardized headers, which helps when automatically extracting information from the header. Often the first 'word' of the header is a unique identifier for the sequence. The header line may contain more than one header, separated by a ^A (Control-A) character (as in [1]). This should be interpreted as both headers pointing to the same sequence below.

After the header line, one or more comments, distinguished by a semi-colon at the beginning of the line, may occur. Most databases and bioinformatics applications do not recognize these comments so their use is discouraged, but they are part of the official format.

After the header line and comments, one or more sequence lines may follow: each line of a sequence should have fewer than 80 characters. Sequences may be protein sequences or DNA sequences, and they can contain gaps or alignment characters (see sequence alignment).

FASTA format files often have file extensions like .fa, .fasta, or .fsa.

The simple format of FASTA files makes them easy to manipulate using text processing tools and scripting languages like Perl.

The NCBI have gone so far as to define a standard for their fasta header (although generally this is a bit messy). The formatdb man page has this to say on the subject of FASTA format databases, "formatdb will automatically parse the SeqID and create indexes, but the database identifiers in the FASTA definition line must follow the conventions of the FASTA Defline Format."

However they do not give a definitive description of the FASTA defline format, an attempt to create such a format is given below.

 GenBank                           gi|gi-number|gb|accession|locus
 EMBL Data Library                 gi|gi-number|emb|accession|locus
 DDBJ, DNA Database of Japan       gi|gi-number|dbj|accession|locus
 NBRF PIR                          pir||entry
 Protein Research Foundation       prf||name
 SWISS-PROT                        sp|accession|name
 Brookhaven Protein Data Bank (1)  pdb|entry|chain
 Brookhaven Protein Data Bank (2)  entry:chain|PDBID|CHAIN|SEQUENCE
 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

The vertical bars in the above list are not separators in the sense of the Backus-Naur form, but are part of the format.

See also

External links