first previous next last contents

IO.h Macros

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>".


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.

This returns 1 when the database has been opened as read-only; 0 otherwise.
This returns the reading name for reading number g. This is fetched from the in memory cache.
Sets the in-memory copy of the reading name for reading number g to be the string n. This does not write to disk.
This returns the type of the primer used for sequencing reading number r. This information is calculated from the primer and strand fields of the GReadings structure. It returns one of GAP_PRIMER_UNKNOWN, GAP_PRIMER_FORWARD, GAP_PRIMER_REVERSE, GAP_PRIMER_CUSTFOR and GAP_PRIMER_CUSTREV.
As PRIMER_TYPE except always choose a sensible guess in place of GAP_PRIMER_UNKNOWN.
Returns the strand (one of 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)
Reads one of the basic database structures. For contigs, 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)
Writes one of the basic types in a similar fashion to the read functions. To write to annotation number anno we should use:
	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.

first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.