376a3438b1a96761c019bbe128908fc69b5083df angie Thu Jul 30 18:04:05 2020 -0700 Adding VCF_NUM_COLS_BEFORE_GENOTYPES to vcf.h to reduce the proliferation of magic number 9's in the code. diff --git src/inc/vcf.h src/inc/vcf.h index 60af930..c9b547f 100644 --- src/inc/vcf.h +++ src/inc/vcf.h @@ -328,30 +328,31 @@ * the ref/ref, ref/alt, alt/alt convention for biallelic variants: * 0/0, * 0/1, 1/1, * 0/2, 1/2, 2/2, * 0/3, 1/3, 2/3, 3/3, * ... */ void vcfCountGenotypes(struct vcfRecord *rec, int **retGtCounts, int **retAlleleCounts, int *retPhasedCount, int *retDiploidCount); /* Tally genotypes and alleles for summary, adding 1 to rec->alleleCount to represent missing data */ char *vcfFilePooledStr(struct vcfFile *vcff, char *str); /* Allocate memory for a string from vcff's shared string pool. */ #define VCF_NUM_COLS 10 +#define VCF_NUM_COLS_BEFORE_GENOTYPES 9 struct asObject *vcfAsObj(); // Return asObject describing fields of VCF char *vcfGetSlashSepAllelesFromWords(char **words, struct dyString *dy); /* Overwrite dy with a /-separated allele string from VCF words, * skipping the extra initial base that VCF requires for indel alleles if necessary. * Return dy->string for convenience. */ void vcfRecordWriteNoGt(FILE *f, struct vcfRecord *rec); /* Write the first 8 columns of VCF rec to f. Genotype data will be ignored if present. */ // Characters we expect to see in |-separated parts of an ##INFO description that specifies // tabular contents: #define COL_DESC_WORD_REGEX "[A-Za-z_0-9.-]+"