{
  "filename": "plot_3.png",
  "iteration": 2,
  "description": "Comprehensive provenance comparison table of all evidence for scully-HSD17B10 orthology",
  "timestamp": "2026-07-01 09:25:14",
  "code": "\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Create a comprehensive provenance summary figure\nfig, ax = plt.subplots(1, 1, figsize=(16, 10))\nax.axis('off')\nax.set_title(\"Provenance Summary: SCU (O18404) vs HSD17B10 (Q99714) Orthology & Function\", \n             fontsize=15, fontweight='bold', pad=20)\n\n# Build the comprehensive comparison table\nheaders = [\"Feature\", \"SCU (O18404)\", \"HSD17B10 (Q99714)\", \"Match\"]\nrows = [\n    [\"Organism\", \"D. melanogaster\", \"H. sapiens\", \"\u2014\"],\n    [\"Protein name\", \"3-hydroxyacyl-CoA DH type-2\", \"3-hydroxyacyl-CoA DH type-2\", \"Identical\"],\n    [\"Length (aa)\", \"255\", \"261\", \"~97%\"],\n    [\"Seq. identity\", \"\u2014\", \"\u2014\", \"73.1%\"],\n    [\"Seq. similarity\", \"\u2014\", \"\u2014\", \"83.1%\"],\n    [\"Pfam domain\", \"PF00106 (adh_short)\", \"PF00106 (adh_short)\", \"Identical\"],\n    [\"InterPro family\", \"IPR002347 (SDR)\", \"IPR002347 (SDR)\", \"Identical\"],\n    [\"PANTHER subfamily\", \"PTHR43658:SF8\", \"PTHR43658:SF8\", \"Identical\"],\n    [\"OrthoDB group\", \"1274115at2759\", \"1274115at2759\", \"Identical\"],\n    [\"eggNOG\", \"KOG1199\", \"KOG1199\", \"Identical\"],\n    [\"EC number\", \"1.1.1.35\", \"1.1.1.35\", \"Identical\"],\n    [\"Rossmann motif\", \"TGGASGLG (pos 10-17)\", \"TGGASGLG (pos 16-23)\", \"Identical\"],\n    [\"Catalytic Ser\", \"S149\", \"S155\", \"Conserved\"],\n    [\"Catalytic Tyr\", \"Y162 (active site)\", \"Y168 (active site)\", \"Conserved\"],\n    [\"Catalytic Lys\", \"K166\", \"K172\", \"Conserved\"],\n    [\"YxxxK motif\", \"YSASK (162-166)\", \"YSASK (168-172)\", \"Identical\"],\n    [\"NCAG motif\", \"pos 84-87\", \"pos 90-93\", \"Identical\"],\n    [\"Binding sites\", \"11 annotated\", \"11 annotated\", \"11/11 (100%)\"],\n    [\"S-Y CA dist. (AF)\", \"8.89 A\", \"8.81 A\", \"Delta 0.08 A\"],\n    [\"S-K CA dist. (AF)\", \"5.92 A\", \"5.87 A\", \"Delta 0.05 A\"],\n    [\"Y-K CA dist. (AF)\", \"6.23 A\", \"6.24 A\", \"Delta 0.01 A\"],\n    [\"pLDDT (mean)\", \"97.4\", \"96.9\", \"Both >95\"],\n    [\"Localization\", \"Mito. matrix (IDA)\", \"Mito. matrix (TAS)\", \"Both mito.\"],\n    [\"RNase P role\", \"MRPP2 (IDA)\", \"MRPP2 (IDA)\", \"Both\"],\n    [\"GO:0003857 (MF)\", \"IEA\", \"IDA\", \"Gap: upgrade?\"],\n    [\"GO:0006635 (BP)\", \"Absent\", \"IDA\", \"Gap: add?\"],\n    [\"GO:0006631 (BP)\", \"IDA\", \"IBA\", \"SCU stronger\"],\n]\n\n# Create table\ntable = ax.table(\n    cellText=rows,\n    colLabels=headers,\n    cellLoc='center',\n    loc='center',\n    colWidths=[0.22, 0.28, 0.28, 0.22]\n)\n\ntable.auto_set_font_size(False)\ntable.set_fontsize(8.5)\ntable.scale(1, 1.25)\n\n# Style header\nfor j in range(4):\n    table[0, j].set_facecolor('#1565C0')\n    table[0, j].set_text_props(color='white', fontweight='bold', fontsize=9)\n\n# Color code match column\nfor i in range(1, len(rows) + 1):\n    match_val = rows[i-1][3]\n    if match_val in ['Identical', 'Conserved', '11/11 (100%)', 'Both mito.', 'Both', 'Both >95']:\n        table[i, 3].set_facecolor('#C8E6C9')  # green\n    elif 'Delta' in match_val and float(match_val.split()[1]) < 0.1:\n        table[i, 3].set_facecolor('#C8E6C9')  # green\n    elif match_val in ['73.1%', '83.1%', '~97%']:\n        table[i, 3].set_facecolor('#DCEDC8')  # light green\n    elif 'Gap' in match_val:\n        table[i, 3].set_facecolor('#FFF9C4')  # yellow - annotation gap\n    elif match_val == 'SCU stronger':\n        table[i, 3].set_facecolor('#E3F2FD')  # light blue\n    \n    # Alternate row shading\n    if i % 2 == 0:\n        for j in range(3):\n            table[i, j].set_facecolor('#F5F5F5')\n\nplt.tight_layout()\nplt.savefig(\"provenance_table.png\", dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Provenance table saved.\")\n",
  "plot_number": 3
}