{
  "filename": "pgrp_catalytic_residues.png",
  "iteration": 1,
  "description": "Visualize catalytic residue conservation showing Ag_PGRPLC lacks key zinc-binding residues for amidase activity",
  "timestamp": "2026-07-05 11:10:56",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\n# ===== Summary of catalytic residue analysis =====\n# Known catalytic residues for zinc-dependent N-acetylmuramoyl-L-alanine amidase activity:\n# Position 1: His (zinc ligand 1) - from HH motif\n# Position 2: Tyr (zinc hydrate coordination / catalytic)\n# Position 3: His (zinc ligand 2)\n# Position 4: Cys (zinc ligand 3) - critical thiol zinc ligand\n\n# Results from alignment (mapping via Dm_PGRP_LB reference: H59, Y95, H169, C177)\n\ndata = {\n    'Protein': [\n        'Dm_PGRP_LB\\n(catalytic)',\n        'Dm_PGRP_SC1b\\n(catalytic)',\n        'Hs_PGLYRP2\\n(catalytic)',\n        'Ag_PGRPLC\\n(TARGET)',\n        'Dm_PGRP_LC\\n(receptor)',\n        'Dm_PGRP_SA\\n(receptor)',\n        'Dm_PGRP_LE\\n(receptor)',\n    ],\n    'H_zinc1': ['H', 'H', 'H', 'A', '-', 'H', '-'],\n    'Y_cat': ['Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'],\n    'H_zinc2': ['H', 'H', 'H', 'H', 'S', 'G', 'H'],\n    'C_zinc3': ['C', 'C', 'C', 'S', 'F', 'S', 'S'],\n}\n\nfig, ax = plt.subplots(figsize=(12, 8))\n\nresidue_labels = ['His (Zn ligand 1)', 'Tyr (catalytic)', 'His (Zn ligand 2)', 'Cys (Zn ligand 3)']\nkeys = ['H_zinc1', 'Y_cat', 'H_zinc2', 'C_zinc3']\nexpected = ['H', 'Y', 'H', 'C']\n\n# Create grid\nn_proteins = len(data['Protein'])\nn_residues = len(residue_labels)\n\nfor i, protein in enumerate(data['Protein']):\n    for j, key in enumerate(keys):\n        residue = data[key][i]\n        exp = expected[j]\n        \n        # Color coding\n        if residue == exp:\n            color = '#2ecc71'  # green - conserved\n        elif residue == '-':\n            color = '#95a5a6'  # gray - gap\n        else:\n            color = '#e74c3c'  # red - substituted\n        \n        rect = plt.Rectangle((j, n_proteins - 1 - i), 0.9, 0.8, \n                             facecolor=color, edgecolor='black', linewidth=1.5)\n        ax.add_patch(rect)\n        \n        # Add residue text\n        fontweight = 'bold' if 'TARGET' in protein else 'normal'\n        ax.text(j + 0.45, n_proteins - 1 - i + 0.4, residue, \n               ha='center', va='center', fontsize=16, fontweight='bold',\n               color='white')\n\n# Labels\nax.set_xlim(-0.5, n_residues + 0.5)\nax.set_ylim(-0.5, n_proteins + 0.5)\n\n# Y-axis: protein names\nfor i, protein in enumerate(data['Protein']):\n    fontweight = 'bold' if 'TARGET' in protein else 'normal'\n    color = 'red' if 'TARGET' in protein else 'black'\n    ax.text(-0.1, n_proteins - 1 - i + 0.4, protein, \n           ha='right', va='center', fontsize=10, fontweight=fontweight, color=color)\n\n# X-axis: residue labels\nfor j, label in enumerate(residue_labels):\n    ax.text(j + 0.45, n_proteins + 0.2, label, \n           ha='center', va='bottom', fontsize=10, fontweight='bold', rotation=0)\n\n# Expected residues at top\nfor j, exp in enumerate(expected):\n    ax.text(j + 0.45, n_proteins + 0.0, f'(expected: {exp})', \n           ha='center', va='bottom', fontsize=8, color='gray')\n\n# Legend\ngreen_patch = mpatches.Patch(color='#2ecc71', label='Conserved (catalytic)')\nred_patch = mpatches.Patch(color='#e74c3c', label='Substituted (non-catalytic)')\ngray_patch = mpatches.Patch(color='#95a5a6', label='Gap / not aligned')\nax.legend(handles=[green_patch, red_patch, gray_patch], loc='lower right', fontsize=10)\n\n# Dividing line between catalytic and non-catalytic\nax.axhline(y=n_proteins - 3 - 0.1, color='blue', linewidth=2, linestyle='--', alpha=0.5)\nax.text(n_residues + 0.3, n_proteins - 1.5, 'CATALYTIC\\nPGRPs', \n       ha='center', va='center', fontsize=9, color='blue', fontweight='bold')\nax.text(n_residues + 0.3, n_proteins - 5.0, 'NON-CATALYTIC\\nRECEPTORS', \n       ha='center', va='center', fontsize=9, color='blue', fontweight='bold')\n\nax.set_axis_off()\nax.set_title('Zinc-Binding Catalytic Residues in PGRP Family\\n'\n            'Ag_PGRPLC (A7UTA1) lacks critical H\u2192A and C\u2192S substitutions',\n            fontsize=14, fontweight='bold', pad=20)\n\nplt.tight_layout()\nplt.savefig('pgrp_catalytic_residues.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"\\nKey finding: Ag_PGRPLC has A (not H) at zinc ligand 1 and S (not C) at zinc ligand 3\")\nprint(\"This pattern matches known non-catalytic receptor PGRPs, not catalytic amidases\")\nprint(\"Conclusion: GO:0008745 (N-acetylmuramoyl-L-alanine amidase activity) is OVER-ANNOTATED\")\n"
}