Go to the source code of this file.
int fai_build |
( |
const char * |
fn | ) |
|
Build index for a FASTA or bgzip-compressed FASTA file.
- Parameters
-
- Returns
- 0 on success; or -1 on failure File "fn.fai" will be generated.
Distroy a faidx_t struct.
- Parameters
-
fai | Pointer to the struct to be destroyed |
char* fai_fetch |
( |
const faidx_t * |
fai, |
|
|
const char * |
reg, |
|
|
int * |
len |
|
) |
| |
Fetch the sequence in a region.
- Parameters
-
fai | Pointer to the faidx_t struct |
reg | Region in the format "chr2:20,000-30,000" |
len | Length of the region; -2 if seq not present, -1 general error |
- Returns
- Pointer to the sequence; null on failure
The returned sequence is allocated by malloc family and should be destroyed by end users by calling free() on it.
faidx_t* fai_load |
( |
const char * |
fn | ) |
|
Load index from "fn.fai".
- Parameters
-
fn | File name of the FASTA file |
int faidx_fetch_nseq |
( |
const faidx_t * |
fai | ) |
|
Fetch the number of sequences.
- Parameters
-
fai | Pointer to the faidx_t struct |
- Returns
- The number of sequences
char* faidx_fetch_seq |
( |
const faidx_t * |
fai, |
|
|
const char * |
c_name, |
|
|
int |
p_beg_i, |
|
|
int |
p_end_i, |
|
|
int * |
len |
|
) |
| |
Fetch the sequence in a region.
- Parameters
-
fai | Pointer to the faidx_t struct |
c_name | Region name |
p_beg_i | Beginning position number (zero-based) |
p_end_i | End position number (zero-based) |
len | Length of the region; -2 if c_name not present, -1 general error |
- Returns
- Pointer to the sequence; null on failure
The returned sequence is allocated by malloc family and should be destroyed by end users by calling free() on it.
int faidx_has_seq |
( |
const faidx_t * |
fai, |
|
|
const char * |
seq |
|
) |
| |
Query if sequence is present
- Parameters
-
fai | Pointer to the faidx_t struct |
seq | Sequence name |
- Returns
- 1 if present or 0 if absent
const char* faidx_iseq |
( |
const faidx_t * |
fai, |
|
|
int |
i |
|
) |
| |
Return name of i-th sequence
int faidx_nseq |
( |
const faidx_t * |
fai | ) |
|
Return number of sequences in fai index
int faidx_seq_len |
( |
const faidx_t * |
fai, |
|
|
const char * |
seq |
|
) |
| |
Return sequence length, -1 if not present