|
LIBRARY#include <biolibc/gff-index.h> -lbiolibc -lxtend SYNOPSISint bl_gff_index_add(bl_gff_index_t *gi, bl_gff_t *feature)ARGUMENTSgi Pointer to gff_index_t object to which a record will be added feature Pointer to GFF feature to be indexed DESCRIPTIONThe gff_index_t class maintains an in-memory index of GFF features, containing the GFF fields SEQ_ID, START, and END, and the offset into the file as reported by ftell(3), or by bl_gff_read(3), which records the file position of each GFF feature it reads.bl_gff_index_add_pos(3) adds a GFF feature with file position file_pos to the index. Features of interest, perhaps only genes or only exons, can be added to the index on-the fly while reading through a GFF file with bl_gff_read(3). The index can later be searched or traversed forward or backward to quickly find the location of a feature and reposition a FILE pointer to it using fseek(3). This system eliminates the need to inhale large numbers of GFF features into memory. RETURN VALUESBL_GFF_INDEX_OK on success, BL_GFF_MALLOC_FAILED if memory could not be allocatedEXAMPLESbl_gff_index_t gi; bl_gff_t feature; if ( bl_gff_read(&feature, gff_stream, BL_GFF_FIELD_ALL) == BL_READ_OK ) { if ( bl_gff_index_add(&gi, &feature) != BL_GFF_INDEX_OK ) fprintf(stderr, "Error addind to GFF index.n"); } SEE ALSObl_gff_index_seek_reverse(3), bl_gff_read(3) Visit the GSP FreeBSD Man Page Interface. |