31dffd2604b7ba4ab85a2dc0d45246ef58838907 angie Wed Mar 15 13:59:23 2017 -0700 Better warning message for HGVS protein terms pasted into hgVai. refs #11460 notes 30, 31. diff --git src/hg/lib/hgHgvs.c src/hg/lib/hgHgvs.c index fcb10a7..0d06599 100644 --- src/hg/lib/hgHgvs.c +++ src/hg/lib/hgHgvs.c @@ -1980,51 +1980,56 @@ row->chrom = cloneString(mapping->chrom); row->pos = pos; row->id = cloneString(term); row->ref = cloneString(vcfRef); row->alt = vcfAlt; row->filter = filter; row->info = info; freeMem(hgvsSeqRef); freeMem(hgvsSeqAlt); dnaSeqFree(&genomicSeq); return row; } struct vcfRow *hgvsToVcfRow(char *db, char *term, boolean doLeftShift, struct dyString *dyError) /* Convert HGVS to a row of VCF suitable for sorting & printing. If unable, return NULL and - * put the reason in dyError. */ + * put the reason in dyError. Protein terms are ambiguous at the nucleotide level so they are + * not supported at this point. */ { struct vcfRow *row = NULL; struct hgvsVariant *hgvs = hgvsParseTerm(term); if (!hgvs) { dyStringPrintf(dyError, "Unable to parse '%s' as HGVS", term); return NULL; } +else if (hgvs->type == hgvstProtein) + { + dyStringPrintf(dyError, "HGVS protein changes such as '%s' are ambiguous at the nucleotide " + "level, so not supported", term); + return NULL; + } struct dyString *dyWarn = dyStringNew(0); char *pslTable = NULL; struct bed *mapping = hgvsValidateAndMap(hgvs, db, term, dyWarn, &pslTable); if (!mapping) { dyStringPrintf(dyError, "Unable to map '%s' to reference %s: %s", term, db, dyStringContents(dyWarn)); } else { - // TODO: Support protein! - //#*** Check if it's nucleotide? struct hgvsChange *changeList = hgvsParseNucleotideChange(hgvs->changes, hgvs->type, dyWarn); if (dyStringIsNotEmpty(dyWarn)) { dyStringPrintf(dyError, "Unable to parse HGVS description in '%s': %s", term, dyStringContents(dyWarn)); } else if (changeList->type == hgvsctRepeat) { dyStringPrintf(dyError, "Can't convert '%s' to VCF: HGVS repeat notation is not supported.", term); } else { row = vcfFromHgvs(db, term, mapping, hgvs, changeList, doLeftShift, dyWarn);