e461209cf1fd3758d63641915cd91ca9c8ab3020
lrnassar
  Thu Sep 24 17:00:10 2026 -0700
Remove tool output accidentally left in the mei description page, per CR. refs #37524

getTrackReferences writes its diagnostics to stdout rather than stderr, so
six "Failed to fetch complete links from NCBI" lines ended up in the
References section of mei.html and rendered as visible text on the track
description page.

NCBI is still not answering, so rather than rerun the tool the references
are now assembled from the citation blocks already present on the six
subtrack pages. That also restores the publisher links for every paper,
which the failed lookups had degraded to bare PubMed URLs.

Also make the INFO SEQ guard in meiHgsvc3CsvToBed.py require a usable
string, so an empty SEQ= value would fall back to the ALT-derived sequence
instead of silently producing an empty one. No record in either callset
carries an empty SEQ today and the rebuilt output is byte-identical.

diff --git src/hg/makeDb/scripts/mei/meiHgsvc3CsvToBed.py src/hg/makeDb/scripts/mei/meiHgsvc3CsvToBed.py
index 310200c8502..9de1c944c8b 100755
--- src/hg/makeDb/scripts/mei/meiHgsvc3CsvToBed.py
+++ src/hg/makeDb/scripts/mei/meiHgsvc3CsvToBed.py
@@ -146,32 +146,33 @@
             color = COLOR_BY_CLASS.get(cls, COLOR_BY_CLASS["Other"])
 
             refSd = float(info.get("REF_SD", 0)) if info.get("REF_SD", False) else 0.0
             refTrf = "True" if info.get("REF_TRF", False) else "False"
             sourceSample = info.get("SAMPLE", "")
             callerCount = int(row[idx["Caller_Count"]]) if row[idx["Caller_Count"]] else 0
             l1meAid = "Yes" if row[idx["L1ME-AID"]] == "1" else "No"
             palmer = "Yes" if row[idx["PALMER"]] == "1" else "No"
 
             # Inserted DNA. Most records follow the VCF convention of carrying the
             # anchor base at ALT[0] (= REF[0]), so the element is ALT minus that
             # base. The PALMER-only records do not: ALT there is the element
             # itself (len(ALT) == SVLEN, and ALT[0] usually differs from REF[0]),
             # and some of them carry a truncated ALT. Those records supply the
             # full element in INFO SEQ, which always matches SVLEN, so prefer it.
-            if "SEQ" in info and info["SEQ"] is not True:
-                insertSeq = info["SEQ"]
+            seq = info.get("SEQ")
+            if isinstance(seq, str) and seq:
+                insertSeq = seq
             else:
                 insertSeq = alt[1:] if len(alt) > 1 else ""
 
             # Name format: <class>-<svLen>:<carrierCount> (e.g. Alu-281:33).
             name = f"{cls}-{svLen}:{carrierCount}"
 
             out.write("\t".join([
                 chrom,
                 str(chromStart),
                 str(chromEnd),
                 name,
                 str(score),
                 ".",
                 str(chromStart),
                 str(chromEnd),