{
  "filename": "comprehensive_evidence.png",
  "iteration": 2,
  "description": "Comprehensive 4-panel summary of all evidence against intein annotation of Rv0311",
  "timestamp": "2026-06-22 00:45:09",
  "code": "\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Create a comprehensive summary figure with all evidence\n\nfig, axes = plt.subplots(2, 2, figsize=(16, 12))\n\n# Panel 1: Foldseek results summary\nax1 = axes[0, 0]\nax1.set_title('Foldseek Structural Homology Search', fontsize=11, fontweight='bold')\nax1.axis('off')\n\nfoldseek_data = [\n    ['AlphaFold DB', '653', 'All uncharacterized\\nproteins', '0', 'E < 1e-55'],\n    ['PDB100', '7', 'TRAPPII (best),\\nno inteins', '0', 'E > 0.23\\n(not significant)'],\n]\ncol_labels = ['Database', 'Hits', 'Top matches', 'Intein\\nhits', 'Best E-value']\ntable1 = ax1.table(cellText=foldseek_data, colLabels=col_labels, loc='center', cellLoc='center')\ntable1.auto_set_font_size(False)\ntable1.set_fontsize(9)\ntable1.scale(1, 2.0)\nfor j in range(5):\n    table1[(0, j)].set_facecolor('#4472C4')\n    table1[(0, j)].set_text_props(color='white', fontweight='bold')\n# Highlight zero intein hits\nfor i in range(1, 3):\n    table1[(i, 3)].set_facecolor('#FFE0E0')\n    table1[(i, 3)].set_text_props(color='red', fontweight='bold')\n\n# Panel 2: Domain database search summary\nax2 = axes[0, 1]\nax2.set_title('Domain Database Search Results', fontsize=11, fontweight='bold')\nax2.axis('off')\n\ndomain_data = [\n    ['NCBI CDD', '0 hits', 'No conserved domain'],\n    ['InterPro', '0 matches', 'No domain recognized'],\n    ['Pfam', '0 families', 'No Pfam family'],\n    ['PROSITE', '0 current', 'No pattern/profile match'],\n    ['InBase', 'Not listed', 'Not a registered intein'],\n    ['KEGG', 'hypothetical', 'No pathway assignment'],\n    ['UniProt', 'TrEMBL, score 1.0', 'Unreviewed, minimal'],\n]\ncol_labels2 = ['Database', 'Result', 'Interpretation']\ntable2 = ax2.table(cellText=domain_data, colLabels=col_labels2, loc='center', cellLoc='center')\ntable2.auto_set_font_size(False)\ntable2.set_fontsize(9)\ntable2.scale(1, 1.6)\nfor j in range(3):\n    table2[(0, j)].set_facecolor('#4472C4')\n    table2[(0, j)].set_text_props(color='white', fontweight='bold')\n\n# Panel 3: Intein catalytic block checklist (visual)\nax3 = axes[1, 0]\nax3.set_title('Intein Catalytic Block Assessment', fontsize=11, fontweight='bold')\n\nblocks = ['Block A\\n(N-Cys/Ser)', 'Block B\\n(TXXH)', 'Block F\\n(DxxHxxG)', 'Block G\\n(pen. His)', 'Block G\\n(term. Asn)',\n          'Hint domain\\nfold', 'LAGLIDADG\\nmotif', 'InterPro\\nintein', 'CDD\\nintein']\nscores = [0, 0, 0, 0, 0, 0, 0, 0, 0]  # All absent\n\ncolors = ['#FF4444' for _ in scores]\nbars = ax3.barh(range(len(blocks)), [1]*len(blocks), color=colors, edgecolor='darkred', height=0.7)\n\n# Add X marks\nfor i, (block, score) in enumerate(zip(blocks, scores)):\n    ax3.text(0.5, i, '\u2717 ABSENT', ha='center', va='center', fontsize=11, \n             fontweight='bold', color='white')\n\nax3.set_yticks(range(len(blocks)))\nax3.set_yticklabels(blocks, fontsize=9)\nax3.set_xlim(0, 1)\nax3.set_xticks([])\nax3.set_xlabel('Score: 0/9 features present', fontsize=10, fontweight='bold')\nax3.invert_yaxis()\n\n# Panel 4: Protein family context\nax4 = axes[1, 1]\nax4.set_title('M. tuberculosis Intein Inventory\\nvs. Rv0311', fontsize=11, fontweight='bold')\nax4.axis('off')\n\ncontext_data = [\n    ['RecA (Rv2737c)', '~440 aa', 'Yes', 'Experimentally\\nvalidated'],\n    ['SufB (Rv1461)', '~147 aa', 'Yes', 'Experimentally\\nvalidated'],\n    ['DnaB (Rv0058)', '~460 aa', 'Yes', 'Experimentally\\nvalidated'],\n    ['Rv0311', '409 aa', 'NO', 'All catalytic\\nresidues absent'],\n]\ncol_labels4 = ['Gene', 'Intein size', 'Intein?', 'Evidence']\ntable4 = ax4.table(cellText=context_data, colLabels=col_labels4, loc='center', cellLoc='center')\ntable4.auto_set_font_size(False)\ntable4.set_fontsize(10)\ntable4.scale(1, 2.0)\nfor j in range(4):\n    table4[(0, j)].set_facecolor('#4472C4')\n    table4[(0, j)].set_text_props(color='white', fontweight='bold')\n# Highlight Rv0311 row\nfor j in range(4):\n    table4[(4, j)].set_facecolor('#FFE0E0')\ntable4[(4, 2)].set_text_props(color='red', fontweight='bold')\n\nplt.suptitle('Rv0311: Comprehensive Evidence Against Intein Annotation', \n             fontsize=14, fontweight='bold', y=0.98)\nplt.tight_layout(rect=[0, 0, 1, 0.96])\nplt.savefig('comprehensive_evidence.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: comprehensive_evidence.png\")\n"
}