




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>
".
io_dbsize(io)
-
io
->db.actual_db_size
max_gel_len(io)
-
(io)
->max_gel_len
NumContigs(io)
-
(io)
->db.num_contigs
NumReadings(io)
-
(io)
->db.num_readings
Ncontigs(io)
-
(io)
->db.Ncontigs
Nreadings(io)
-
(io)
->db.Nreadings
Nannotations(io)
-
(io)
->db.Nannotations
Ntemplates(io)
-
(io)
->db.Ntemplates
Nclones(io)
-
(io)
->db.Nclones
Nvectors(io)
-
(io)
->db.Nvectors
io_relpos(io,g)
-
(io)
->relpos[(
g)]
io_length(io,g)
-
(io)
->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)
-
(io)
->lnbr[(
g)]
io_rnbr(io,g)
-
(io)
->rnbr[(
g)]
io_clength(io,c)
-
(io)
->relpos[io_dbsize(
io)-(
c)]
io_clnbr(io,c)
-
(io)
->lnbr[io_dbsize(
io)-(
c)]
io_crnbr(io,c)
-
(io)
->rnbr[io_dbsize(
io)-(
c)]
io_name(io)
-
(io)
->db_name
io_rdonly(io)
- This returns 1 when the database has been opened as read-only; 0 otherwise.
io_rname(io,g)
- This returns the reading name for reading number g. This is fetched from the in memory cache.
io_wname(io,g,n)
- Sets the in-memory copy of the reading name for reading number g to be the string n. This does not write to disk.
PRIMER_TYPE(r)
-
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
andGAP_PRIMER_CUSTREV
. PRIMER_TYPE_GUESS(r)
-
As
PRIMER_TYPE
except always choose a sensible guess in place ofGAP_PRIMER_UNKNOWN
. STRAND(r)
-
Returns the strand (one of
GAP_STRAND_FORWARD
orGAP_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 isgel_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 thegel_write
function must be used instead ofGT_Write
asgel_write
will also update the reading memory cache.





This page is maintained by staden-package. Last generated on 25 April 2003.
URL: http://www.mrc-lmb.cam.ac.uk/pubseq/manual/scripting_121.html