fai_build
Build index for a FASTA or razip compressed FASTA file.
fai_destroy
Distroy a faidx_t struct.
fai_load
Load index from "fn.fai".
fai_fetch
Fetch the sequence in a region.

fai_build


Build index for a FASTA or razip compressed FASTA file.

void fai_build(
    const char *fn);  
Parameters
fn
FASTA file name
Discussion

File "fn.fai" will be generated.


fai_destroy


Distroy a faidx_t struct.

void fai_destroy(
    faidx_t *fai);  
Parameters
fai
Pointer to the struct to be destroyed


fai_load


Load index from "fn.fai".

faidx_t *fai_load(
    const char *fn);  
Parameters
fn
File name of the FASTA file


fai_fetch


Fetch the sequence in a region.

char *fai_fetch(
    const faidx_t *fai,
    const char *reg,
    int *len);  
Parameters
fai
Pointer to the faidx_t struct
reg
Region in the format "chr2:20,000-30,000"
len
Length of the region
Return Value

Pointer to the sequence; null on failure

Discussion

The returned sequence is allocated by malloc family and should be destroyed by end users by calling free() on it.

© The Wellcome Trust Sanger Institute. Last Updated: Saturday, June 13, 2009