first previous next last contents

calc_quality

#include <qual.h>

int calc_quality(
        int     contig,
        int     start,
        int     end,
        char   *qual,
        float   cons_cutoff,
        int     qual_cutoff,
        int   (*info_func)(int          job,
                           void        *mydata,
                           info_arg_t  *theirdata),
        void   *info_data)

int database_info(
        int          job,
        void        *mydata,
        info_arg_t  *theirdata);

This function calculates the quality codes for a given segment of a contig consensus sequence. The quality information is stored in the qual buffer, which should be allocated by the caller to be at least end-start+1 bytes long. The contents of this buffer is one byte per base, consisting of a letter between 'a' and 'j'. There are #defines in `qual.h' assigning meanings to these codes, which should be used in preference to hard coding the codes themselves. The defines and meanings are as follows.

a - R_GOOD_GOOD_EQ
Data is good on both strands and both strands agree on the same consensus base.
b - R_GOOD_BAD
Data is good on the top strand, but poor on the bottom strand.
c - R_BAD_GOOD
Data is good on the bottom strand, but poor on the top strand.
d - R_GOOD_NONE
Data is good on the top strand, but no data is available on the bottom strand.
e - R_NONE_GOOD
Data is good on the bottom strand, but no data is available on the top strand.
f - R_BAD_BAD
Data is available on both strands, but both strands are poor data.
g - R_BAD_NONE
Data is poor on the top strand, with no data on the bottom strand.
h - R_NONE_BAD
Data is poor on the bottom strand, with no data on the top strand.
i - R_GOOD_GOOD_NE
Data is good on both strands, but the consensus base differs between top and bottom strand.
j - R_NONE_NONE
No data is available on either strand (this should never occur).

The contig, start and end arguments hold the contig and range to calculate the quality for. The ranges are inclusive and start counting with the first base as position 1.

qual_cutoff and cons_cutoff hold the quality and consensus cutoff parameters. These are used in an identical manner to the calc_quality function. See section calc_quality.

The info_func and info_data arguments are also used in the same way as calc_quality. Generally info_func should be database_info and info_data should be a GapIO pointer. This will then read the sequence data from the Gap4 database.

The function returns 0 for success, -1 for failure.


first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.
URL: http://www.mrc-lmb.cam.ac.uk/pubseq/manual/scripting_155.html