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/tp53FuncPrelim.py src/hg/makeDb/scripts/tp53/tp53FuncPrelim.py index 844f0538dad..c66b4395779 100644 --- src/hg/makeDb/scripts/tp53/tp53FuncPrelim.py +++ src/hg/makeDb/scripts/tp53/tp53FuncPrelim.py @@ -179,31 +179,31 @@ variants = load_variants(src_xlsx) print(" {} missense variants".format(len(variants))) from collections import Counter print(" Distribution: {}".format(Counter(v['code'] for v in variants))) raw_scores = lib.load_per_paper_raw_scores() print(" Per-paper raw-score lookup: {} unique missense changes".format( len(raw_scores))) bed_lines = generate_bed(variants, tx, raw_scores) print(" {} BED rows".format(len(bed_lines))) as_file = os.path.join(outdir, "TP53FuncPrelim.as") lib.write_autosql(as_file, AUTOSQL) bed = os.path.join(outdir, "TP53FuncPrelim_{}.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, "TP53FuncPrelim{}.bb".format(db.capitalize())) lib.run_bedToBigBed(bed, as_file, bb, lib.chrom_sizes_path(db), "bed9+7") 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.') p.add_argument('--src', default=DEFAULT_SRC) args = p.parse_args() dbs = args.db if args.db else ['hg38'] for db in dbs: build(db, args.output_dir, args.src)