4125d0a689e877858fdd2e2f27063631c8410f84 angie Wed Apr 12 16:20:35 2017 -0700 vcfGetSlashSepAllelesFromWords needs to handle ALT=. (no alternate allele observed). diff --git src/lib/vcf.c src/lib/vcf.c index 8598768..a2acfa7 100644 --- src/lib/vcf.c +++ src/lib/vcf.c @@ -1463,38 +1463,41 @@ chopByChar(altAlCopy, ',', &(alleles[1]), alCount-1); int i; if (allelesHavePaddingBase(alleles, alCount)) { // Skip padding base (unless we have a symbolic allele): for (i = 0; i < alCount; i++) if (isAllNt(alleles[i], strlen(alleles[i]))) alleles[i]++; } // Having dealt with left padding base, now look for identical bases on the right: int trimmedBases = countIdenticalBasesRight(alleles, alCount); // Build a /-separated allele string, trimming bases on the right if necessary: dyStringClear(dy); for (i = 0; i < alCount; i++) { + char *allele = alleles[i]; + if (!sameString(allele, ".")) + { if (i > 0) dyStringAppendC(dy, '/'); - char *allele = alleles[i]; if (allele[trimmedBases] == '\0') dyStringAppendC(dy, '-'); else dyStringAppendN(dy, allele, strlen(allele)-trimmedBases); } + } return dy->string; } static void vcfWriteWordArrayWithSep(FILE *f, int count, char **words, char sep) /* Write words joined by sep to f (or, if count is zero, "."). */ { if (count < 1) fputc('.', f); else { fputs(words[0], f); int i; for (i = 1; i < count; i++) { fputc(sep, f);