GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  FAIDX (5)

NAME

faidx - an index enabling random access to FASTA files

CONTENTS

Synopsis
Description
     FASTA Files
Example
See Also

SYNOPSIS

file.fa.fai, file.fasta.fai

DESCRIPTION

Using an fai index file in conjunction with a FASTA file containing reference sequences enables efficient access to arbitrary regions within those reference sequences. The index file typically has the same filename as the corresponding FASTA file, with .fai appended.

An fai index file is a text file consisting of lines each with five TAB-delimited columns:

NAMEName of this reference sequence
LENGTHTotal length of this reference sequence, in bases
OFFSETOffset within the FASTA file of this sequence’s first base
LINEBASESThe number of bases on each line
LINEWIDTHThe number of bytes in each line, including the newline

The NAME and LENGTH columns contain the same data as would appear in the SN and LN fields of a SAM @SQ header for the same reference sequence.

The OFFSET column contains the offset within the FASTA file, in bytes starting from zero, of the first base of this reference sequence, i.e., of the character following the newline at the end of the ">" header line. Typically the lines of a fai index file appear in the order in which the reference sequences appear in the FASTA file, so .fai files are typically sorted according to this column.

The LINEBASES column contains the number of bases in each of the sequence lines that form the body of this reference sequence, apart from the final line which may be shorter. The LINEWIDTH column contains the number of bytes in each of the sequence lines (except perhaps the final line), thus differing from LINEBASES in that it also counts the bytes forming the line terminator.

    FASTA Files

In order to be indexed with samtools faidx, a FASTA file must be a text file of the form

>name [description...]
ATGCATGCATGCATGCATGCATGCATGCAT
GCATGCATGCATGCATGCATGCATGCATGC
ATGCAT
>name [description...]
ATGCATGCATGCAT
GCATGCATGCATGC
[...]

In particular, each reference sequence must be "well-formatted", i.e., all of its sequence lines must be the same length, apart from the final sequence line which may be shorter. (While this sequence line length must be the same within each sequence, it may vary between different reference sequences in the same FASTA file.)

This also means that although the FASTA file may have Unix- or Windows-style or other line termination, the newline characters present must be consistent, at least within each reference sequence.

The samtools implementation uses the first word of the ">" header line text (i.e., up to the first whitespace character, having skipped any initial whitespace after the ">") as the NAME column.

EXAMPLE

For example, given this FASTA file

>one
ATGCATGCATGCATGCATGCATGCATGCAT
GCATGCATGCATGCATGCATGCATGCATGC
ATGCAT
>two another chromosome
ATGCATGCATGCAT
GCATGCATGCATGC

formatted with Unix-style (LF) line termination, the corresponding fai index would be

one6653031
two28981415

If the FASTA file were formatted with Windows-style (CR-LF) line termination, the fai index would be

one6663032
two281031416

SEE ALSO

samtools(1)
http://en.wikipedia.org/wiki/FASTA_format
  Further description of the FASTA format
Search for    or go to Top of page |  Section 5 |  Main Index


htslib FAIDX (5) August 2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.