bl_gff_read(3)

LIBRARY
#include <biolibc/gff.h>
-lbiolibc -lxtend

SYNOPSIS

int     bl_gff_read(bl_gff_t *feature, FILE *gff_stream,
gff_field_mask_t field_mask)

ARGUMENTS
feature         Pointer to a bl_gff_t structure
gff_stream      A FILE stream from which to read the line
field_mask      Bit mask indicating which fields to store in feature

DESCRIPTION
Read next feature (line) from a GFF file. feature must be initialized using BL_GFF_INIT or bl_gff_init() before being passed to this function. bl_gff_read() will allocate memory for string fields as needed. The object should be passed to bl_gff_free() as soon as possible after the data are no longer needed. If passed an object that is not in an initialized state, bl_gff_read() will free and initialize it before repopulating it with a new feature. If field_mask is not BL_GFF_FIELD_ALL, fields not indicated by a 1 in the bit mask are discarded rather than stored in feature. That field in the structure is then populated with an appropriate marker, such as '.'. Possible mask values are: BL_GFF_FIELD_ALL BL_GFF_FIELD_SEQID BL_GFF_FIELD_SOURCE BL_GFF_FIELD_TYPE BL_GFF_FIELD_START BL_GFF_FIELD_END BL_GFF_FIELD_SCORE BL_GFF_FIELD_STRAND BL_GFF_FIELD_PHASE BL_GFF_FIELD_ATTRIBUTES

RETURN VALUES
BL_READ_OK on successful read BL_READ_EOF if EOF is encountered after a complete feature BL_READ_TRUNCATED if EOF or bad data is encountered elsewhere

EXAMPLES
bl_gff_skip_header(stdin);
bl_gff_init(&feature);
bl_gff_read(&feature, stdin, BL_GFF_FIELD_ALL);
bl_gff_read(&feature, gff_stream,
    BL_GFF_FIELD_SEQID|BL_GFF_FIELD_START|BL_GFF_FIELD_END);

SEE ALSO
bl_gff_write(3)