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/processClinGenCnv.py src/hg/utils/otto/clinGen/processClinGenCnv.py
index b867e9f..afd2120 100755
--- src/hg/utils/otto/clinGen/processClinGenCnv.py
+++ src/hg/utils/otto/clinGen/processClinGenCnv.py
@@ -32,45 +32,45 @@
 def parseLiftFile(fname):
     global chromLift
     with open(fname) as f:
         for line in f:
             l = line.strip().split()
             ncbiChrom = l[1]
             ucscChrom = l[3]
             chromLift[ncbiChrom] = ucscChrom
 
 def getColor(cnvtype, pathOrBen):
     """Return the shade of the item according to it's variant type."""
     if cnvtype not in ["copy_number_loss","copy_number_gain"] or pathOrBen not in ["Benign", "Pathogenic"]:
         return "0,0,0"
     if cnvtype == "copy_number_loss":
         if pathOrBen == "Pathogenic":
-            return "255,104,104"
+            return "180,3,16"
         else:
-            return "231,154,144"
+            return "238,146,148"
     if cnvtype == "copy_number_gain":
         if pathOrBen == "Pathogenic":
-            return "103,104,255"
+            return "17,44,138"
         else:
-            return "143,184,214"
+            return "122,165,211"
 
 def getMouseover(bed):
     """Return the mouseOver string for this bed record."""
     ret = ""
-    ret += "%s:%s-%s" % (bed["chrom"], int(bed["chromStart"])+1, bed["chromEnd"])
+    ret += "Gene(s) affected: %s" % (", ".join(bed["ClinGen"]))
+    ret += ", Position: %s:%s-%s" % (bed["chrom"], int(bed["chromStart"])+1, bed["chromEnd"])
     ret += ", Size: %d" % (int(bed["chromEnd"]) - int(bed["chromStart"]))
-    ret += ", Gene(s) affected: %s" % (", ".join(bed["ClinGen"]))
     if bed["Variant Type"] == "copy_number_loss":
         ret += ", Type: loss"
     else:
         ret += ", Type: gain"
     ret += ", Significance: %s" % bed["Clinical Interpretation"]
     ret += ", Phenotype: %s" % bed["Phenotype"]
     return ret
 
 def dumpBedLines():
     """Write out the bed lines, with the same number of fields in each line."""
     fields = bed9Fields +  extraFieldList + ["_mouseOver"]
     print("#%s" % ("\t".join(fields)))
     for b in bedLines:
         bed = bedLines[b]
         finalBed = []