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 "
The maximum number of readings plus contigs allowed.
The maximum reading length.
The number of used contigs.
The number of used readings.
The number of allocated contigs.
The number of allocated readings.
The number of allocated annotations.
The number of annotated templates.
The number of allocated clones.
The number of allocated vectors.
The position of a reading g.
The length of a reading g. If the reading is complemented this value is negative, but still represents the length.
The reading number of the left neighbour of reading g.
The reading number of the right neighbour of reading g.
The length of contig c.
The leftmost reading number of contig c.
The rightmost reading number of contig c.
The database name.
PRIMER_TYPEexcept always choose a sensible guess in place of
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_readreads 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_readwhich 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_writefunction must be used instead of
gel_writewill also update the reading memory cache.