There are many C macros defined to interact with the GapIO structure. These both simplify and improve readeability of the code and also provide a level of future proofing. Where the macros are available it is always advisable to use these instead of accessing the GapIO structure directly.
Note that not all of these macros are actually held within the `IO.h'
file, rather some are in files included by `IO.h'. However whenever
wishing to use one of these macros you should still use "#include
<IO.h>".
io_dbsize(io)
->db.actual_db_sizemax_gel_len(io)
->max_gel_lenNumContigs(io)
->db.num_contigsNumReadings(io)
->db.num_readingsNcontigs(io)
->db.NcontigsNreadings(io)
->db.NreadingsNannotations(io)
->db.NannotationsNtemplates(io)
->db.NtemplatesNclones(io)
->db.NclonesNvectors(io)
->db.Nvectorsio_relpos(io,g)
->relpos[(g)]io_length(io,g)
->length[(g)]The length of a reading g. If the reading is complemented this value is negative, but still represents the length.
io_lnbr(io,g)
->lnbr[(g)]io_rnbr(io,g)
->rnbr[(g)]io_clength(io,c)
->relpos[io_dbsize(io)-(c)]io_clnbr(io,c)
->lnbr[io_dbsize(io)-(c)]io_crnbr(io,c)
->rnbr[io_dbsize(io)-(c)]io_name(io)
->db_nameio_rdonly(io)
io_rname(io,g)
io_wname(io,g,n)
PRIMER_TYPE(r)
GAP_PRIMER_UNKNOWN, GAP_PRIMER_FORWARD,
GAP_PRIMER_REVERSE, GAP_PRIMER_CUSTFOR and
GAP_PRIMER_CUSTREV.
PRIMER_TYPE_GUESS(r)
PRIMER_TYPE except always choose a sensible guess in place
of GAP_PRIMER_UNKNOWN.
STRAND(r)
GAP_STRAND_FORWARD or
GAP_STRAND_REVERSE) from the primer information for reading
number r. The reason for these primer and strand macros is that
the meaning of the primer and strand fields of
GReadings has changed slightly from early code in that we now
make a distinction between custom forward primers and custom reverse
primers. The strand field may become completely redundant in
future as it can now be derived entirely from the primer.
contig_read(io, cn, c)
gel_read(io, gn, g)
tag_read(io, tn, t)
vector_read(io, vn, v)
clone_read(io, cn, c)
contig_read reads contig number cn and stores in the
GContigs structure named c. Eg to read the a contig:
GContigs c; contig_read(io, contig_num, c);This is functionally equivalent to:
GContigs c; GT_Read(io, arr(GCardinal, io->contigs, contig_num-1), &c, sizeof(c), GT_Contigs);The exception to this is
gel_read which reads from a cached
copy held in memory.
contig_write(io, cn, c)
gel_write(io, gn, g)
tag_write(io, tn, t)
vector_write(io, vn, v)
clone_write(io, cn, c)
GAnnotations a; /* ... some code to manipulate 'a' ... */ tag_write(io, anno, a);This is functionally equivalent to:
GT_Write(io, arr(GCardinal, io->annotations, anno-1), &a, sizeof(a), GT_Annotations);Note that the
gel_write function must be used instead
of GT_Write as gel_write will also update the reading
memory cache.