bl_overlap_set_all(3)

NAME
bl_overlap_set_all() - Set overlap fields for two features

LIBRARY
#include <biolibc/overlap.h>
-lbiolibc -lxtend

SYNOPSIS
int     bl_overlap_set_all(bl_overlap_t *overlap,
int64_t feature1_len, int64_t feature2_len,
int64_t overlap_start, int64_t overlap_end)

ARGUMENTS
feature1_len      Length of feature 1
feature2_len      Length of feature 2
overlap_start    Start position of overlap relative to start of feature 1
overlap_end      End position of overlap relative to start of feature 1

DESCRIPTION
Set all fields in a bl_overlap_t structure. Start and end positions are 1-based regardless of the feature type. (BED file positions are 0-based and must be adjusted before passed to this function.)

RETURN VALUES
BL_DATA_OK upon success. BL_DATA_INVALID is arguments don't make sense.

EXAMPLES
    bed_start = BL_BED_CHROM_START(bed_feature);
    bed_end = BL_BED_CHROM_END(bed_feature);
    gff3_start = BL_GFF3_CHROM_START(gff3_feature);
    gff3_end = BL_GFF3_CHROM_END(gff3_feature);
    bed_len = bed_end - bed_start;
    gff3_len = gff3_end - gff3_start + 1;
    bl_overlap_set_all(overlap, bed_len, gff3_len,
                    XT_MAX(bed_start+1, gff3_start),
                    XT_MIN(bed_end, gff3_end));

SEE ALSO
bl_overlap_print(3)