Show code
import os, hashlib
import pandas as pd
REPO = os.environ.get("PIGNET_REPO", os.path.abspath(os.path.join(os.getcwd(), "..")))
# --- Provenance manifest: every raw input, its source, and how to regenerate it. ---
INPUTS = {
"certified_hits": {
"path": "comparative-genomics/analysis/certified_hits.csv",
"what": "certified selection hits (gene, set, K, direction) from the primate dichromatism scan "
"— MOTIVATION ONLY; no selection value is a load-bearing claim in this notebook",
"source": "HPC HyPhy aBSREL/RELAX scan output (DATA_SOURCES.md; comparative-genomics/analysis/README.md)",
"produced_by": "comparative-genomics pipeline (commit c67a6ae)",
},
"hormone_axes": {
"path": "comparative-genomics/analysis/data/hormone_axes.csv",
"what": "53 sex-hormone genes labeled by endocrine axis",
"source": "Seeded from KEGG steroid hormone biosynthesis (hsa00140, 27 genes) + KEGG GnRH signaling (hsa04912, 8 genes), plus androgen/estrogen receptor->target genes (AR, ESR1/2, GPER1, FSHR, LHCGR) and steroid-signaling cofactors/carriers (NCOA1/2/3, NCOR1/2, SHBG, FKBP5, SCARB1, LDLR, STAR, KISS1/1R) added per design; then axis-annotated",
"produced_by": "Notebook 13 (KEGG pathway pull + design-added receptors/cofactors, then axis-annotated)",
},
"receptor_gate": {
"path": "data/processed/nb13_melanocyte_receptor_expression.csv",
"what": "receptor-in-melanocyte expression gate (is each hormone receptor expressed in melanocytes?)",
"source": "Zhang et al. 2018, Genome Res 28:1621-1635, PMID 30333196, doi:10.1101/gr.233304.117 "
"(106 primary-melanocyte cis-eQTL; Tables S6/S11) + cited dermatology literature",
"produced_by": "hand-curated for NB13 (per-row source column carries the citation)",
},
"bridge_citations": {
"path": "data/processed/nb13_bridge_citations.csv",
"what": "citation backbone: one row per hormone->pigment bridge finding, with PMID/DOI/tier",
"source": "primary literature; all 6 PMIDs verified against PubMed "
"(Natale 2016, Filardo 2002, Tadokoro 1997, Zouboulis 2007, Spalkowska 2021, Im 2002)",
"produced_by": "hand-curated for NB13",
},
"interlayer_edges": {
"path": "data/processed/nb13_hormone_interlayer_edges.csv",
"what": "hormone-receptor -> pigmentation-core edges added by NB13, each with citation_pmid + expression_gate",
"source": "primary literature (per-edge citation_pmid column)",
"produced_by": "hand-curated for NB13",
},
"substrate_nodes": {
"path": "data/processed/nb7_substrate_nodes.csv",
"what": "803-node harmonized pigmentation substrate (read-only input; NB13 merges onto a copy)",
"source": "docs/specs/nb7_substrate.spec.md",
"produced_by": "Notebook 07 (harmonized multi-layer substrate)",
},
"substrate_edges": {
"path": "data/processed/nb7_substrate_edges.csv",
"what": "7819 harmonized substrate edges (read-only input)",
"source": "docs/specs/nb7_substrate.spec.md",
"produced_by": "Notebook 07 (harmonized multi-layer substrate)",
},
}
def load_input(key):
"""Load a manifest input, printing its provenance and a checksum of the exact bytes read."""
m = INPUTS[key]; fp = os.path.join(REPO, m["path"])
raw = open(fp, "rb").read(); sha = hashlib.sha256(raw).hexdigest()[:16]
df = pd.read_csv(fp)
print(f"[{key}] {m['path']}")
print(f" what : {m['what']}")
print(f" source : {m['source']}")
print(f" produced : {m['produced_by']}")
print(f" loaded : {df.shape[0]} rows x {df.shape[1]} cols | sha256[:16]={sha}\n")
return df
CERT = load_input("certified_hits")
HAX = load_input("hormone_axes")
GATE = load_input("receptor_gate")
CITES = load_input("bridge_citations")
EDGES13= load_input("interlayer_edges")
NODES7 = load_input("substrate_nodes")
EDGES7 = load_input("substrate_edges")[certified_hits] comparative-genomics/analysis/certified_hits.csv
what : certified selection hits (gene, set, K, direction) from the primate dichromatism scan — MOTIVATION ONLY; no selection value is a load-bearing claim in this notebook
source : HPC HyPhy aBSREL/RELAX scan output (DATA_SOURCES.md; comparative-genomics/analysis/README.md)
produced : comparative-genomics pipeline (commit c67a6ae)
loaded : 9 rows x 6 cols | sha256[:16]=0ce07e83840d4a2c
[hormone_axes] comparative-genomics/analysis/data/hormone_axes.csv
what : 53 sex-hormone genes labeled by endocrine axis
source : Seeded from KEGG steroid hormone biosynthesis (hsa00140, 27 genes) + KEGG GnRH signaling (hsa04912, 8 genes), plus androgen/estrogen receptor->target genes (AR, ESR1/2, GPER1, FSHR, LHCGR) and steroid-signaling cofactors/carriers (NCOA1/2/3, NCOR1/2, SHBG, FKBP5, SCARB1, LDLR, STAR, KISS1/1R) added per design; then axis-annotated
produced : Notebook 13 (KEGG pathway pull + design-added receptors/cofactors, then axis-annotated)
loaded : 53 rows x 2 cols | sha256[:16]=bba7cfd487770220
[receptor_gate] data/processed/nb13_melanocyte_receptor_expression.csv
what : receptor-in-melanocyte expression gate (is each hormone receptor expressed in melanocytes?)
source : Zhang et al. 2018, Genome Res 28:1621-1635, PMID 30333196, doi:10.1101/gr.233304.117 (106 primary-melanocyte cis-eQTL; Tables S6/S11) + cited dermatology literature
produced : hand-curated for NB13 (per-row source column carries the citation)
loaded : 8 rows x 9 cols | sha256[:16]=6bcbfc85952192db
[bridge_citations] data/processed/nb13_bridge_citations.csv
what : citation backbone: one row per hormone->pigment bridge finding, with PMID/DOI/tier
source : primary literature; all 6 PMIDs verified against PubMed (Natale 2016, Filardo 2002, Tadokoro 1997, Zouboulis 2007, Spalkowska 2021, Im 2002)
produced : hand-curated for NB13
loaded : 6 rows x 7 cols | sha256[:16]=e251eadb6f0bc8a0
[interlayer_edges] data/processed/nb13_hormone_interlayer_edges.csv
what : hormone-receptor -> pigmentation-core edges added by NB13, each with citation_pmid + expression_gate
source : primary literature (per-edge citation_pmid column)
produced : hand-curated for NB13
loaded : 4 rows x 13 cols | sha256[:16]=eae079f132296fd3
[substrate_nodes] data/processed/nb7_substrate_nodes.csv
what : 803-node harmonized pigmentation substrate (read-only input; NB13 merges onto a copy)
source : docs/specs/nb7_substrate.spec.md
produced : Notebook 07 (harmonized multi-layer substrate)
loaded : 803 rows x 17 cols | sha256[:16]=4053c652a8d4f832
[substrate_edges] data/processed/nb7_substrate_edges.csv
what : 7819 harmonized substrate edges (read-only input)
source : docs/specs/nb7_substrate.spec.md
produced : Notebook 07 (harmonized multi-layer substrate)
loaded : 7819 rows x 12 cols | sha256[:16]=688c378fc1364cad

