50a4c6d772288c9a281f87d7feec3e8fda168452
angie
Tue Jan 17 14:15:55 2012 -0800
VCF genotype details: one more proportion needed to be converted to percent, to match the rest.
diff --git src/hg/hgc/vcfClick.c src/hg/hgc/vcfClick.c
index 9b64613..9436cf1 100644
--- src/hg/hgc/vcfClick.c
+++ src/hg/hgc/vcfClick.c
@@ -163,31 +163,31 @@
gtOther++;
}
}
printf("Genotype count: %d (%d phased)
\n", vcff->genotypeCount, phasedGts);
double refAf = (double)refs/(2*vcff->genotypeCount);
double altAf = (double)alts/(2*vcff->genotypeCount);
printf("Alleles: %s: %d (%.3f%%); %s: %d (%.3f%%)
\n",
rec->alleles[0], refs, 100*refAf, rec->alleles[1], alts, 100*altAf);
if (vcff->genotypeCount > 1)
{
printf("Genotypes: %s/%s: %d (%.3f%%); %s/%s: %d (%.3f%%); %s/%s: %d (%.3f%%)",
rec->alleles[0], rec->alleles[0], refRefs, 100*(double)refRefs/vcff->genotypeCount,
rec->alleles[0], rec->alleles[1], refAlts, 100*(double)refAlts/vcff->genotypeCount,
rec->alleles[1], rec->alleles[1], altAlts, 100*(double)altAlts/vcff->genotypeCount);
if (gtOther > 0)
- printf("; other: %d (%.3f)", gtOther, (double)gtOther/vcff->genotypeCount);
+ printf("; other: %d (%.3f%%)", gtOther, 100*(double)gtOther/vcff->genotypeCount);
printf("
\n");
if (rec->alleleCount == 2)
printf("Hardy-Weinberg equilibrium: "
"P(%s/%s) = %.3f%%; P(%s/%s) = %.3f%%; P(%s/%s) = %.3f%%
",
rec->alleles[0], rec->alleles[0], 100*refAf*refAf,
rec->alleles[0], rec->alleles[1], 100*2*refAf*altAf,
rec->alleles[1], rec->alleles[1], 100*altAf*altAf);
}
jsBeginCollapsibleSection(cart, track, "genotypes", "Detailed genotypes", FALSE);
dyStringClear(tmp1);
dyStringAppend(tmp1, rec->format);
enum vcfInfoType formatTypes[256];
char *formatKeys[256];
int formatCount = chopString(tmp1->string, ":", formatKeys, ArraySize(formatKeys));
puts("Genotype info key:
");