2c0f74b4fbfefc533d27bf3ccdc18e4ecfdecae7 angie Fri Oct 5 17:07:18 2012 -0700 Follow-up to ce70491d:1. Move hgTracks left-base-of-indel trimming code up to vcf.[ch] for sharing w/hgc. 2. Correct chromStart in hgTracks mapBox links to hgc when we have trimmed a left base. 3. In hgc, abbreviate long sequences (e.g. 40kb deletion) and show trimmed left base in parentheses for consistency with VCF file (and sometimes INFO fields that use left-inclusive coords/seqs). 4. In pgSnpFromVcfRecord, don't truncate long alleles because hgTracks and hgc do their own abbreviating. diff --git src/hg/lib/pgSnp.c src/hg/lib/pgSnp.c index e5b07b5..8db8265 100644 --- src/hg/lib/pgSnp.c +++ src/hg/lib/pgSnp.c @@ -798,40 +798,34 @@ { struct dyString *dy = dyStringNew(0); struct pgSnp *pgs; AllocVar(pgs); pgs->chrom = rec->chrom; pgs->chromStart = rec->chromStart; pgs->chromEnd = rec->chromEnd; // Build up slash-separated allele string from rec->alleles, starting with ref allele: dyStringAppend(dy, rec->alleles[0]); int alCount = rec->alleleCount, i; if (rec->alleleCount == 2 && sameString(rec->alleles[1], ".")) // ignore N/A alternate allele alCount = 1; else if (rec->alleleCount >= 2) { - // append /-sep'd alternate alleles, unless/until it gets too long: + // append /-sep'd alternate alleles for (i = 1; i < rec->alleleCount; i++) - { - if ((dy->stringSize + 1 + strlen(rec->alleles[i])) > VCF_MAX_ALLELE_LEN) - break; dyStringPrintf(dy, "/%s", rec->alleles[i]); } - if (i < rec->alleleCount) - alCount = i; - } pgs->name = cloneStringZ(dy->string, dy->stringSize+1); pgs->alleleCount = alCount; pgs->alleleFreq = alleleCountsFromVcfRecord(rec, alCount); // Build up comma-sep list... supposed to be per-allele quality scores but I think // the VCF spec only gives us one BQ... for the reference position? should ask. dyStringClear(dy); for (i = 0; i < rec->infoCount; i++) if (sameString(rec->infoElements[i].key, "BQ") && !rec->infoElements[i].missingData[0]) { float qual = rec->infoElements[i].values[0].datFloat; dyStringPrintf(dy, "%.1f", qual); int j; for (j = 1; j < rec->alleleCount; j++) dyStringPrintf(dy, ",%.1f", qual); break;