5390b51b1beb4c37c736b3b910dce64f065892e2 angie Thu Sep 5 11:03:31 2013 -0700 VCF annoRows need to have corrected coords for indels, otherwise it messesup coord comparison in annoGrator. Also, that lets us get rid of the ugly skippedFirstBase hack in annoFormatVep and annoGratorGpVar. diff --git src/lib/vcf.c src/lib/vcf.c index 3f3754a..39178e2 100644 --- src/lib/vcf.c +++ src/lib/vcf.c @@ -1070,32 +1070,31 @@ " string info; \"Additional information encoded as a semicolon-separated series " "of short keys with optional comma-separated values\"" " string format; \"If genotype columns are specified in header, a " "semicolon-separated list of of short keys starting with GT\"" " string genotypes; \"If genotype columns are specified in header, a tab-separated " "set of genotype column values; each value is a colon-separated " "list of values corresponding to keys in the format column\"" " )"; struct asObject *vcfAsObj() // Return asObject describing fields of VCF { return asParseText(vcfDataLineAutoSqlString); } -char *vcfGetSlashSepAllelesFromWords(char **words, struct dyString *dy, - boolean *retSkippedFirstBase) +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. */ { dyStringClear(dy); // VCF reference allele gets its own column: char *refAllele = words[3]; char *altAlleles = words[4]; // First determine whether there is an extra initial base that we need to skip: boolean allStartSame = TRUE; char *p; while ((p = strchr(altAlleles, ',')) != NULL) { if (altAlleles[0] != refAllele[0]) allStartSame = FALSE; @@ -1118,19 +1117,17 @@ dyStringAppendC(dy, '/'); int len = p - altAlleles - offset; if (len == 0) dyStringAppendC(dy, '-'); else dyStringAppendN(dy, altAlleles+offset, len); altAlleles = p+1; } dyStringAppendC(dy, '/'); int len = strlen(altAlleles) - offset; if (len == 0) dyStringAppendC(dy, '-'); else dyStringAppendN(dy, altAlleles+offset, len); } -if (retSkippedFirstBase) - *retSkippedFirstBase = offset; return dy->string; }