85b50d205c9a3dec2daf25805e3cf3a929b19a05
gperez2
  Wed May 13 10:57:25 2026 -0700
Updating the mouseDevTimecourse superTrack per author requests: Renamed shortLabel and longLabel. Made the superTrack on by default with only M21 TPM visible. Added a priority setting. Reordered tissues in .facets files (documented in makedocs). refs #37001

diff --git src/hg/makeDb/doc/mm39/mouseDevTimecourse.txt src/hg/makeDb/doc/mm39/mouseDevTimecourse.txt
index 279fd4d2703..ddc3f29f0e0 100644
--- src/hg/makeDb/doc/mm39/mouseDevTimecourse.txt
+++ src/hg/makeDb/doc/mm39/mouseDevTimecourse.txt
@@ -1,37 +1,91 @@
 # Mouse Development Timecourse bulk RNA-seq (2026-04-10 Gerardo)
 # Converting track hub from Wold Lab (Caltech) into native tracks.
 # Hub URL: http://woldlab.caltech.edu/~diane/mouse_development_bulk/mouse_development.hub.txt
 # Publication: https://www.encodeproject.org/publications/e0d01543-9965-4edb-933c-778a40575cd9/
 # mm39 data are liftOver'd from mm10 GENCODE M21 alignments.
 # 17 tissues, up to 8 timepoints (e10.5-e16.5, P0), two replicates per condition.
 # bigBarChart tracks with FPKM and TPM from RSEM.
 
 # Download data files from hub to /hive/data/outside/
 mkdir -p /hive/data/outside/woldlab/mouseDevTimecourse/mm39
 cd /hive/data/outside/woldlab/mouseDevTimecourse/mm39
 
 for f in mouse_development_TPM_M21_mm39.bb mouse_development_FPKM_M21_mm39.bb \
     mouse_development_M21.categories mouse_development_M21.facets; do
     curl -o "$f" "http://woldlab.caltech.edu/~diane/mouse_development_bulk/$f"
 done
 
 # Create symlinks in /gbdb/mm39/
 mkdir -p /gbdb/mm39/mouseDevTimecourse
 cd /gbdb/mm39/mouseDevTimecourse
 for f in /hive/data/outside/woldlab/mouseDevTimecourse/mm39/*; do
     ln -s "$f" .
 done
 
 # Add trackDb entry
 cd ~/kent/src/hg/makeDb/trackDb/mouse/mm39
 # Created mouseDevTimecourse.ra (superTrack with 2 bigBarChart subtracks)
 # Created HTML description files:
 #   mouseDevTimecourse.html (supertrack)
 #   developmentTimecourseM21mm39TPM.html
 #   developmentTimecourseM21mm39FPKM.html
 # Added "include mouseDevTimecourse.ra" to trackDb.ra
 
 # Load trackDb
 cd ~/kent/src/hg/makeDb/trackDb
 make DBS=mm39
+
+# 2026-05-13 (Gerardo): Reorder tissue rows in .facets files per author
+# request. Redmine #36998 note-43. Peng (lead author) asked
+# for the tissues to be displayed in his biological order instead of the
+# alphabetical order from the hub. The reorder is made to the files in
+# /hive/data/outside/woldlab/mouseDevTimecourse/mm39/ only; the hub at
+# woldlab.caltech.edu still has the alphabetical order, so re-running the
+# curl above will overwrite the reorder and require re-running the snippet
+# below.
+
+cd /hive/data/outside/woldlab/mouseDevTimecourse/mm39
+
+python3 <<'EOF'
+TISSUE_ORDER = [
+    "thymus",
+    "spleen",
+    "liver",
+    "heart",
+    "skeletal muscle tissue",
+    "urinary bladder",
+    "adrenal gland",
+    "kidney",
+    "lung",
+    "stomach",
+    "intestine",
+    "limb",
+    "embryonic facial prominence",
+    "forebrain",
+    "midbrain",
+    "hindbrain",
+    "neural tube",
+]
+FILES = ["mouse_development_M21.facets"]
+
+for path in FILES:
+    with open(path) as f:
+        lines = f.readlines()
+    header = lines[0]
+    data = []
+    for ln in lines[1:]:
+        if ln.strip():
+            data.append(ln)
+    groups = {}
+    for ln in data:
+        cols = ln.rstrip("\n").split("\t")
+        groups.setdefault(cols[2], []).append(ln)
+    out = [header]
+    for tissue in TISSUE_ORDER:
+        for ln in groups[tissue]:
+            out.append(ln)
+    with open(path, "w") as f:
+        f.writelines(out)
+    print("reordered: " + path + "  (" + str(len(data)) + " rows)")
+EOF
 ##############################################################################