Gamgee
You miserable little maggot. I'll stove your head in!
|
#include "config.h"
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include "htslib/bgzf.h"
#include "htslib/faidx.h"
#include "htslib/khash.h"
#include "htslib/knetfile.h"
Classes | |
struct | faidx1_t |
struct | __faidx_t |
Macros | |
#define | kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) |
Functions | |
faidx_t * | fai_build_core (BGZF *bgzf) |
void | fai_save (const faidx_t *fai, FILE *fp) |
faidx_t * | fai_read (FILE *fp) |
void | fai_destroy (faidx_t *fai) |
int | fai_build (const char *fn) |
FILE * | download_and_open (const char *fn) |
faidx_t * | fai_load (const char *fn) |
char * | fai_fetch (const faidx_t *fai, const char *str, int *len) |
int | faidx_nseq (const faidx_t *fai) |
const char * | faidx_iseq (const faidx_t *fai, int i) |
int | faidx_seq_len (const faidx_t *fai, const char *seq) |
char * | faidx_fetch_seq (const faidx_t *fai, const char *c_name, int p_beg_i, int p_end_i, int *len) |
int | faidx_has_seq (const faidx_t *fai, const char *seq) |
#define kroundup32 | ( | x | ) | (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) |
FILE* download_and_open | ( | const char * | fn | ) |
int fai_build | ( | const char * | fn | ) |
Build index for a FASTA or bgzip-compressed FASTA file.
fn | FASTA file name |
void fai_destroy | ( | faidx_t * | fai | ) |
Distroy a faidx_t struct.
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.
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 |
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".
fn | File name of the FASTA file |
faidx_t* fai_read | ( | FILE * | fp | ) |
void fai_save | ( | const faidx_t * | fai, |
FILE * | fp | ||
) |
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.
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 |
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
fai | Pointer to the faidx_t struct |
seq | Sequence name |
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