a56d88e05670b759ff3b32829542537ccc790c57 lrnassar Tue Apr 28 19:18:20 2026 -0700 Address CR feedback on insight + tp53 hub scripts. refs #37418 Drop duplicated bash() wrappers in favor of subprocess.run / check_output with list args, eliminating shell=True, embedded-quote concerns, and stderr-into-stdout merging. Centralize common operations as run_sort_bed/run_liftOver in tp53FuncLib alongside existing run_bedToBigBed. Switch HTML escaping to stdlib html.escape() consistently. insightHCIPriors mouseover (previously unescaped) now escapes HGVS fields, addressing the specific c.123A>G case Jonathan flagged. Replace invalid
tags with
across all five affected mouseover sites. diff --git src/hg/makeDb/scripts/tp53/tp53CancerHotspots.py src/hg/makeDb/scripts/tp53/tp53CancerHotspots.py index 09901e7a9f4..202633ed040 100644 --- src/hg/makeDb/scripts/tp53/tp53CancerHotspots.py +++ src/hg/makeDb/scripts/tp53/tp53CancerHotspots.py @@ -147,31 +147,31 @@ def build(db, outdir): print("=== {} ===".format(db)) os.makedirs(outdir, exist_ok=True) data = fetch_or_load(outdir) records = records_for_tp53(data) print(" {} TP53 PM1 records".format(len(records))) tx = lib.get_transcript_info(db) bed_lines = generate_bed(records, tx) print(" {} BED rows".format(len(bed_lines))) as_file = os.path.join(outdir, "TP53CancerHotspots.as") lib.write_autosql(as_file, AUTOSQL) bed = os.path.join(outdir, "TP53CancerHotspots_{}.bed".format(db)) with open(bed, 'w') as f: f.write("\n".join(bed_lines) + "\n") - lib.bash("sort -k1,1 -k2,2n {0} -o {0}".format(bed)) + lib.run_sort_bed(bed) bb = os.path.join(outdir, "TP53CancerHotspots{}.bb".format(db.capitalize())) lib.run_bedToBigBed(bed, as_file, bb, lib.chrom_sizes_path(db), "bed9+4") print(" wrote {}".format(bb)) def main(): p = argparse.ArgumentParser(description=__doc__) p.add_argument('-o', '--output-dir', default=DEFAULT_OUTDIR) p.add_argument('--db', action='append', help='hg38 or hg19 (repeat). Default hg38.') args = p.parse_args() dbs = args.db if args.db else ['hg38'] for db in dbs: build(db, args.output_dir)