vcf.c
/***************************************************************************
 *  Library:
 *      #include <biolibc/vcf.h>
 *      -lbiolibc -lxtend
 *
 *  Description:
 *      Determine if a VCF call is downstream of a SAM alignment.
 *      For the purpose of this function, this could mean on the same
 *      chrom and higher position, or on a later chrom.
 *
 *  Arguments:
 *      vcf_call    Pointer to bl_vcf_t structure containing VCF call
 *      sam_alignment   Pointer to bl_sam_t structure containing alignment
 *
 *  Returns:
 *      true if the call is downstream of the alignment
 *      false otherwise
 *
 *  See also:
 *      bl_vcf_call_in_alignment(3)
 *
 *  History: 
 *  Date        Name        Modification
 *  2020-05-26  Jason Bacon Begin
 ***************************************************************************/
#include 
-lbiolibc -lxtend

Determine if a VCF call is downstream of a SAM alignment.
For the purpose of this function, this could mean on the same
chrom and higher position, or on a later chrom.

vcf_call    Pointer to bl_vcf_t structure containing VCF call
sam_alignment   Pointer to bl_sam_t structure containing alignment

true if the call is downstream of the alignment
false otherwise



Date        Name        Modification
2020-05-26  Jason Bacon Begin
#include - lbiolibc - lxtend Determine if a VCF call is downstream of a SAM alignment . For the purpose of this function this could mean on the same chrom and higher position or on a later chrom . vcf_call Pointer to bl_vcf_t structure containing VCF call sam_alignment Pointer to bl_sam_t structure containing alignment true if the call is downstream of the alignment false otherwise Date Name Modification 2020 - 05 - 26 Jason Bacon Begin
bool    bl_vcf_call_downstream_of_alignment(bl_vcf_t *vcf_call,
	    bl_sam_t *alignment)
{
    if ( (BL_SAM_POS(alignment) + BL_SAM_SEQ_LEN(alignment) <= BL_VCF_POS(vcf_call)) &&
	  (strcmp(BL_SAM_RNAME(alignment), BL_VCF_CHROM(vcf_call)) == 0) )
	return true;
    else if ( bl_chrom_name_cmp(BL_SAM_RNAME(alignment), BL_VCF_CHROM(vcf_call)) < 0 )
	return true;
    else
	return false;
}
bool bl_vcf_call_downstream_of_alignment ( bl_vcf_t * vcf_call , bl_sam_t * alignment ) { if ( ( BL_SAM_POS ( alignment ) + BL_SAM_SEQ_LEN ( alignment ) <= BL_VCF_POS ( vcf_call ) ) && ( strcmp ( BL_SAM_RNAME ( alignment ) , BL_VCF_CHROM ( vcf_call ) ) == 0 ) ) return true ; else if ( bl_chrom_name_cmp ( BL_SAM_RNAME ( alignment ) , BL_VCF_CHROM ( vcf_call ) ) < 0 ) return true ; else return false ; }
Library:
      #include <biolibc/vcf.h>
      -lbiolibc -lxtend
Library : #include <biolibc / vcf . h > - lbiolibc - lxtend
/*fprintf(stderr, "bl_vcf_call_downstream_of_alignment(): %s,%zu,%zu %s,%zu\n",
	    BL_SAM_RNAME(sam_alignment),BL_SAM_POS(sam_alignment),
	    BL_SAM_SEQ_LEN(sam_alignment),
	    BL_VCF_CHROM(vcf_call),BL_VCF_POS(vcf_call));*/