34b96568359c6125704a1eb7455dd39e99744a72 chmalee Thu Jul 2 10:36:03 2020 -0700 Fix up the ClinGen Dosage and CNV colors and mouseovers, refs #24818,#25562 diff --git src/hg/utils/otto/clinGen/processClinGenDosage.py src/hg/utils/otto/clinGen/processClinGenDosage.py index 3563fec..acd48c7 100755 --- src/hg/utils/otto/clinGen/processClinGenDosage.py +++ src/hg/utils/otto/clinGen/processClinGenDosage.py @@ -63,45 +63,45 @@ print("duplicate info for gene symbol: '%s'" % (geneSymbol)) sys.exit(1) except KeyError: extraInfo[geneSymbol] = {} for keyName,ix in zip(extraFieldList[1:],range(len(extraFieldList[1:]))): try: if fieldMatch.match(keyName): continue extraInfo[geneSymbol][keyName] = extra[ix] except IndexError: sys.exit(1) def getColor(bed, dosageType): """Return the shade of the item according to it's variant type.""" if dosageType == "haplo": - if bed["score"] == -1: return "128,128,128" - if bed["score"] == 0: return "191,191,191" - if bed["score"] == 1: return "191,115,115" - if bed["score"] == 2: return "191,93,96" - if bed["score"] == 3: return "255,51,0" - if bed["score"] == 30: return "160,136,246" - if bed["score"] == 40: return "255,204,204" + if bed["score"] == -1: return "218,215,215" + if bed["score"] == 0: return "130,128,128" + if bed["score"] == 1: return "232,104,111" + if bed["score"] == 2: return "218,44,55" + if bed["score"] == 3: return "180,3,16" + if bed["score"] == 30: return "137,93,189" + if bed["score"] == 40: return "238,146,148" if dosageType == "triplo": - if bed["score"] == -1: return "128,128,128" - if bed["score"] == 0: return "191,191,191" - if bed["score"] == 1: return "180,198,231" - if bed["score"] == 2: return "142,169,219" - if bed["score"] == 3: return "48,84,150" - if bed["score"] == 30: return "160,136,246" - if bed["score"] == 40: return "217,255,242" + if bed["score"] == -1: return "218,215,215" + if bed["score"] == 0: return "130,128,128" + if bed["score"] == 1: return "88,131,211" + if bed["score"] == 2: return "41,78,174" + if bed["score"] == 3: return "17,44,138" + if bed["score"] == 30: return "137,93,189" + if bed["score"] == 40: return "122,165,211" def getMouseover(bed, dosageType): """Return the mouseOver string for this bed record.""" ret = "Gene: %s" % bed["name"] if dosageType == "triplo": ret += ", Triplosensitivity: " else: ret += ", Haplosensitivity: " ret += "%s - %s" % (bed["score"], scoreExplanation[bed["score"]]) return ret def dumpBedLines(dosageType): """Write out the bed lines, with the same number of fields in each line.""" oppMatchStr = "triplo" if dosageType == "haplo" else "haplo|loss" extraFields = [x for x in extraFieldList if not re.match(oppMatchStr, x, re.I) and x != "Gene Symbol" and x != "Genomic Location"]