gff.c
/***************************************************************************
 *  Use auto-c2man to generate a man page from this comment
 *
 *  Library:
 *      #include <biolibc/gff.h>
 *      -lbiolibc -lxtend
 *
 *  Description:
 *      Return the amount of overlap between a GFF feature and a SAM
 *      alignment.
 *  
 *  Arguments:
 *      feature     Pointer to a bl_gff_t object
 *      alignment   Pointer to a bl_sam_t object
 *
 *  Returns:
 *      The number of bases of overlap between the feature and alignment.
 *      A zero or negative return value indicates no overlap.
 *
 *  See also:
 *      bl_sam_gff_overlap(3)
 *
 *  History: 
 *  Date        Name        Modification
 *  2022-04-07  Jason Bacon Begin
 ***************************************************************************/
Use auto-c2man to generate a man page from this comment
Library:
#include 
-lbiolibc -lxtend

Return the amount of overlap between a GFF feature and a SAM
alignment.

feature     Pointer to a bl_gff_t object
alignment   Pointer to a bl_sam_t object

The number of bases of overlap between the feature and alignment.
A zero or negative return value indicates no overlap.



Date        Name        Modification
2022-04-07  Jason Bacon Begin
Use auto - c2man to generate a man page from this comment Library : #include - lbiolibc - lxtend Return the amount of overlap between a GFF feature and a SAM alignment . feature Pointer to a bl_gff_t object alignment Pointer to a bl_sam_t object The number of bases of overlap between the feature and alignment . A zero or negative return value indicates no overlap . Date Name Modification 2022 - 04 - 07 Jason Bacon Begin
int64_t bl_gff_sam_overlap(bl_gff_t *feature, bl_sam_t *alignment)
{
    int64_t alignment_end = BL_SAM_POS(alignment) + BL_SAM_SEQ_LEN(alignment),
	    overlap_start = MAX(BL_GFF_START(feature), BL_SAM_POS(alignment)),
	    overlap_end = MIN(BL_GFF_END(feature), alignment_end);
    return overlap_end - overlap_start + 1;
}
int64_t bl_gff_sam_overlap ( bl_gff_t * feature , bl_sam_t * alignment ) { int64_t alignment_end = BL_SAM_POS ( alignment ) + BL_SAM_SEQ_LEN ( alignment ) , overlap_start = MAX ( BL_GFF_START ( feature ) , BL_SAM_POS ( alignment ) ) , overlap_end = MIN ( BL_GFF_END ( feature ) , alignment_end ) ; return overlap_end - overlap_start + 1 ; }
Use auto-c2man to generate a man page from this comment
  Library:
      #include <biolibc/gff.h>
      -lbiolibc -lxtend
Use auto - c2man to generate a man page from this comment Library : #include <biolibc / gff . h > - lbiolibc - lxtend
//fprintf(stderr, "%" PRId64 " %" PRId64 "\n", overlap_start, overlap_end); //fprintf(stderr, "Coverage = %" PRId64 "\n", overlap_end - overlap_start + 1);