#include <tagUtils.h> GAnnotations *ctagget( GapIO *io, int gel, char *type); GAnnotations *vtagget( GapIO *io, int gel, int num_t, char **type);
These function provides a mechanism of iterating around all the available tags
of particular types on a given reading or contig number. The ctagget
function searches for a single tag type, passed in type as a 4 byte
string. The vtagget
function searches for a set of tag types, passed as
an array of num_t 4 byte strings.
To use the functions, call them with a non zero gel number and the tag
type(s). The function will return a pointer to a GAnnotations structure
containing the first tag on this reading or contig of this type. If none are
found, NULL
is returned.
To find the next tag on this reading or contig, of the same type, call the
function with gel set to 0. To find all the tags of this type, keep
repeating this until NULL
is returned.
Returns a GAnnotations pointer for success, NULL
for "not found",
and (GAnnotations *)-1
for failure. The annotation pointer returned is
valid until the next call of the function.
For example, the following function prints information on all vector tags for a given reading.
void print_tags(GapIO *io, int rnum) { char *type[] = {"SVEC", "CVEC"}; GAnnotations *a; a = vtagget(io, rnum, sizeof(types)/sizeof(*types), types); while (a && a != (GAnnotations *)-1) { printf("position %d, length %d\n", a->position, a->length);e a = vtagget(io, 0, sizeof(types)/sizeof(*types), types); } }