{
  "filename": "evidence_comparison.png",
  "iteration": 1,
  "description": "Evidence comparison visualization: CG4860 vs Arc42 as SCAD orthologs, including sequence identity heatmap and functional evidence comparison",
  "timestamp": "2026-07-01 05:48:37",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(1, 2, figsize=(14, 6))\n\n# Panel A: Sequence identity heatmap\nlabels = ['CG4860', 'Arc42', 'Hs ACADS', 'Hs IVD', 'Dro IVD']\n# Identity matrix (from pairwise alignments)\nidentity_matrix = np.array([\n    [100.0, 62.1, 57.1, 36.4, 37.5],   # CG4860\n    [62.1, 100.0, 71.1, 37.6, 0],       # Arc42 (Dro IVD not computed)\n    [57.1, 71.1, 100.0, 0, 0],          # Hs ACADS\n    [36.4, 37.6, 0, 100.0, 0],          # Hs IVD\n    [37.5, 0, 0, 0, 100.0],             # Dro IVD\n])\n# Fill missing with NaN for display\nidentity_display = identity_matrix.copy()\nidentity_display[identity_display == 0] = np.nan\n\nax = axes[0]\nim = ax.imshow(identity_display, cmap='YlOrRd', vmin=30, vmax=100, aspect='auto')\nax.set_xticks(range(len(labels)))\nax.set_yticks(range(len(labels)))\nax.set_xticklabels(labels, rotation=45, ha='right', fontsize=9)\nax.set_yticklabels(labels, fontsize=9)\nax.set_title('Pairwise Sequence Identity (%)\\n(BLOSUM62 alignment)', fontsize=11, fontweight='bold')\n\n# Add text annotations\nfor i in range(len(labels)):\n    for j in range(len(labels)):\n        val = identity_display[i, j]\n        if not np.isnan(val):\n            color = 'white' if val > 65 else 'black'\n            ax.text(j, i, f'{val:.1f}', ha='center', va='center', fontsize=9, color=color, fontweight='bold')\n        else:\n            ax.text(j, i, 'n/d', ha='center', va='center', fontsize=8, color='gray')\n\nplt.colorbar(im, ax=ax, shrink=0.8)\n\n# Panel B: Evidence summary bar chart\nax2 = axes[1]\nevidence_categories = [\n    'Sequence identity\\nto Hs ACADS',\n    'Catalytic Glu\\nconservation',\n    'Domain\\narchitecture',\n    'In vivo SCAD\\nphenotype (LOF)',\n    'Acylcarnitine\\nprofile match'\n]\ncg4860_scores = [57.1, 100, 100, 0, 0]  # Percent or binary (100=yes, 0=no)\narc42_scores = [71.1, 100, 100, 100, 100]\n\nx = np.arange(len(evidence_categories))\nwidth = 0.35\n\nbars1 = ax2.bar(x - width/2, cg4860_scores, width, label='CG4860', color='#e74c3c', alpha=0.8)\nbars2 = ax2.bar(x + width/2, arc42_scores, width, label='Arc42', color='#2ecc71', alpha=0.8)\n\nax2.set_ylabel('Score / Identity %', fontsize=10)\nax2.set_title('CG4860 vs Arc42: Evidence for\\nSCAD Function', fontsize=11, fontweight='bold')\nax2.set_xticks(x)\nax2.set_xticklabels(evidence_categories, fontsize=8)\nax2.legend(fontsize=10)\nax2.set_ylim(0, 115)\nax2.axhline(y=50, color='gray', linestyle='--', alpha=0.3)\n\n# Add value labels on bars\nfor bar in bars1:\n    height = bar.get_height()\n    if height > 0:\n        ax2.text(bar.get_x() + bar.get_width()/2., height + 1, f'{height:.0f}',\n                ha='center', va='bottom', fontsize=8, fontweight='bold')\n    else:\n        ax2.text(bar.get_x() + bar.get_width()/2., 3, 'No',\n                ha='center', va='bottom', fontsize=8, color='red', fontweight='bold')\n\nfor bar in bars2:\n    height = bar.get_height()\n    ax2.text(bar.get_x() + bar.get_width()/2., height + 1, f'{height:.0f}',\n            ha='center', va='bottom', fontsize=8, fontweight='bold')\n\nplt.tight_layout()\nplt.savefig('evidence_comparison.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: evidence_comparison.png\")\n"
}