overlap.c
/***************************************************************************
 *  Library:
 *      #include <biolibc/overlap.h>
 *      -lbiolibc -lxtend
 *
 *  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.)
 *
 *  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
 *
 *  Returns:
 *      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);
 *          gff_start = BL_GFF_CHROM_START(gff_feature);
 *          gff_end = BL_GFF_CHROM_END(gff_feature);
 *          bed_len = bed_end - bed_start;
 *          gff_len = gff_end - gff_start + 1;
 *          bl_overlap_set_all(overlap, bed_len, gff_len,
 *                          MAX(bed_start+1, gff_start),
 *                          MIN(bed_end, gff_end));
 *
 *  See also:
 *      bl_overlap_print(3)
 *
 *  History: 
 *  Date        Name        Modification
 *  2021-04-09  Jason Bacon Begin
 ***************************************************************************/
#include 
-lbiolibc -lxtend

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

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







Date        Name        Modification
2021-04-09  Jason Bacon Begin
#include - lbiolibc - lxtend 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 . ) 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 Date Name Modification 2021 - 04 - 09 Jason Bacon Begin
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)
{
    overlap->feature1_len = feature1_len;
    overlap->feature2_len = feature2_len;
    overlap->overlap_start = overlap_start;
    overlap->overlap_end = overlap_end;
    overlap->overlap_len = overlap_end - overlap_start + 1;
    return BL_OVERLAP_DATA_OK;
}
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 ) { overlap -> feature1_len = feature1_len ; overlap -> feature2_len = feature2_len ; overlap -> overlap_start = overlap_start ; overlap -> overlap_end = overlap_end ; overlap -> overlap_len = overlap_end - overlap_start + 1 ; return BL_OVERLAP_DATA_OK ; }
Library:
      #include <biolibc/overlap.h>
      -lbiolibc -lxtend
Library : #include <biolibc / overlap . h > - lbiolibc - lxtend
// FIXME: Return BL_DATA_INVALID if sanity checks fail