vcf.c
/***************************************************************************
 *  Library:
 *      #include <biolibc/vcf.h>
 *      -lbiolibc -lxtend
 *
 *  Description:
 *      Write static fields from one line of a single-entry VCF file.
 *      Does not write sample data.
 *
 *      If field_mask is not BL_VCF_FIELD_ALL, fields not indicated by a 1
 *      in the bit mask are written as an appropriate placeholder such as '.'
 *      rather than the actual data.  Possible mask values are:
 *
 *      BL_VCF_FIELD_ALL
 *      BL_VCF_FIELD_CHROM
 *      BL_VCF_FIELD_POS
 *      BL_VCF_FIELD_ID
 *      BL_VCF_FIELD_REF
 *      BL_VCF_FIELD_ALT
 *      BL_VCF_FIELD_QUAL
 *      BL_VCF_FIELD_FILTER
 *      BL_VCF_FIELD_INFO
 *      BL_VCF_FIELD_FORMAT
 *
 *  Arguments:
 *      vcf_stream  FILE pointer to the VCF output stream
 *      vcf_call    Pointer to the bl_vcf_t structure to output
 *      field_mask  Bit mask indicating which fields to output
 *
 *  Returns:
 *      The number of items output (as returned by fprintf())
 *
 *  See also:
 *      bl_vcf_read_static_fields(3), bl_vcf_write_ss_call(3)
 *
 *  History: 
 *  Date        Name        Modification
 *  2020-01-22  Jason Bacon Begin
 ***************************************************************************/
#include 
-lbiolibc -lxtend

Write static fields from one line of a single-entry VCF file.
Does not write sample data.

If field_mask is not BL_VCF_FIELD_ALL, fields not indicated by a 1
in the bit mask are written as an appropriate placeholder such as '.'
rather than the actual data.  Possible mask values are.



vcf_stream  FILE pointer to the VCF output stream
vcf_call    Pointer to the bl_vcf_t structure to output
field_mask  Bit mask indicating which fields to output

The number of items output (as returned by fprintf())



Date        Name        Modification
2020-01-22  Jason Bacon Begin
#include - lbiolibc - lxtend Write static fields from one line of a single - entry VCF file . Does not write sample data . If field_mask is not BL_VCF_FIELD_ALL fields not indicated by a 1 in the bit mask are written as an appropriate placeholder such as ' . ' rather than the actual data . Possible mask values are . vcf_stream FILE pointer to the VCF output stream vcf_call Pointer to the bl_vcf_t structure to output field_mask Bit mask indicating which fields to output The number of items output ( as returned by fprintf () ) Date Name Modification 2020 - 01 - 22 Jason Bacon Begin
int     bl_vcf_write_static_fields(bl_vcf_t *vcf_call, FILE *vcf_stream,
	    vcf_field_mask_t field_mask)
{
    char    *chrom = ".",
	    pos_str[BL_POSITION_MAX_DIGITS+1] = ".",
	    *id = ".",
	    *ref = ".",
	    *alt = ".",
	    *qual = ".",
	    *filter = ".",
	    *info = ".",
	    *format = ".";
    if ( field_mask & BL_VCF_FIELD_CHROM )
	chrom = vcf_call->chrom;
    if ( field_mask & BL_VCF_FIELD_POS )
	ltostrn(pos_str, vcf_call->pos, 10, BL_POSITION_MAX_DIGITS);
    if ( field_mask & BL_VCF_FIELD_ID )
	id = vcf_call->id;
    if ( field_mask & BL_VCF_FIELD_REF )
	ref = vcf_call->ref;
    if ( field_mask & BL_VCF_FIELD_ALT )
	alt = vcf_call->alt;
    if ( field_mask & BL_VCF_FIELD_QUAL )
	qual = vcf_call->qual;
    if ( field_mask & BL_VCF_FIELD_FILTER )
	filter = vcf_call->filter;
    if ( field_mask & BL_VCF_FIELD_INFO )
	info = vcf_call->info;
    if ( field_mask & BL_VCF_FIELD_FORMAT )
	format = vcf_call->format;
    return fprintf(vcf_stream,
	    "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t",
	    chrom, pos_str,
	    id, ref, alt, 
	    qual, filter, info,
	    format);
}
int bl_vcf_write_static_fields ( bl_vcf_t * vcf_call , FILE * vcf_stream , vcf_field_mask_t field_mask ) { char * chrom = " " , pos_str [ BL_POSITION_MAX_DIGITS + 1 ] = " " , * id = " " , * ref = " " , * alt = " " , * qual = " " , * filter = " " , * info = " " , * format = " " ; if ( field_mask & BL_VCF_FIELD_CHROM ) chrom = vcf_call -> chrom ; if ( field_mask & BL_VCF_FIELD_POS ) ltostrn ( pos_str , vcf_call -> pos , 10 , BL_POSITION_MAX_DIGITS ) ; if ( field_mask & BL_VCF_FIELD_ID ) id = vcf_call -> id ; if ( field_mask & BL_VCF_FIELD_REF ) ref = vcf_call -> ref ; if ( field_mask & BL_VCF_FIELD_ALT ) alt = vcf_call -> alt ; if ( field_mask & BL_VCF_FIELD_QUAL ) qual = vcf_call -> qual ; if ( field_mask & BL_VCF_FIELD_FILTER ) filter = vcf_call -> filter ; if ( field_mask & BL_VCF_FIELD_INFO ) info = vcf_call -> info ; if ( field_mask & BL_VCF_FIELD_FORMAT ) format = vcf_call -> format ; return fprintf ( vcf_stream , " \t \t \t \t \t \t \t \t \t " , chrom , pos_str , id , ref , alt , qual , filter , info , format ) ; }
Library:
      #include <biolibc/vcf.h>
      -lbiolibc -lxtend
Library : #include <biolibc / vcf . h > - lbiolibc - lxtend