{
  "filename": "tam10_plddt.png",
  "iteration": 1,
  "description": "Analyze AlphaFold structure confidence for tam10 to assess structural disorder and domain architecture",
  "timestamp": "2026-07-04 22:09:45",
  "code": "\nimport requests\nimport json\n\n# Check AlphaFold confidence for tam10\n# Download the PDB and check pLDDT scores\naf_url = \"https://alphafold.ebi.ac.uk/files/AF-G2TRQ9-F1-model_v6.pdb\"\nresponse = requests.get(af_url)\nif response.status_code == 200:\n    pdb_content = response.text\n    lines = pdb_content.split('\\n')\n    \n    # Extract pLDDT scores from B-factor column (columns 61-66 in ATOM records)\n    residue_plddt = {}\n    for line in lines:\n        if line.startswith('ATOM') and line[12:16].strip() == 'CA':\n            resnum = int(line[22:26].strip())\n            plddt = float(line[60:66].strip())\n            residue_plddt[resnum] = plddt\n    \n    print(f\"=== AlphaFold pLDDT scores for tam10 ===\")\n    print(f\"Number of residues: {len(residue_plddt)}\")\n    \n    # Calculate statistics\n    plddt_values = list(residue_plddt.values())\n    import numpy as np\n    print(f\"Mean pLDDT: {np.mean(plddt_values):.1f}\")\n    print(f\"Median pLDDT: {np.median(plddt_values):.1f}\")\n    print(f\"Min pLDDT: {np.min(plddt_values):.1f}\")\n    print(f\"Max pLDDT: {np.max(plddt_values):.1f}\")\n    \n    # Categorize\n    very_high = sum(1 for v in plddt_values if v >= 90)\n    high = sum(1 for v in plddt_values if 70 <= v < 90)\n    low = sum(1 for v in plddt_values if 50 <= v < 70)\n    very_low = sum(1 for v in plddt_values if v < 50)\n    \n    print(f\"\\nConfidence categories:\")\n    print(f\"  Very high (\u226590): {very_high} ({100*very_high/len(plddt_values):.1f}%)\")\n    print(f\"  High (70-90): {high} ({100*high/len(plddt_values):.1f}%)\")\n    print(f\"  Low (50-70): {low} ({100*low/len(plddt_values):.1f}%)\")\n    print(f\"  Very low (<50): {very_low} ({100*very_low/len(plddt_values):.1f}%)\")\n    \n    # Show per-region scores\n    print(f\"\\nPer-region average pLDDT:\")\n    regions = {\n        \"N-term disordered (1-35)\": range(1, 36),\n        \"Coiled-coil (35-95)\": range(35, 96),\n        \"Disordered (48-97)\": range(48, 98),\n        \"SMAP domain (101-167)\": range(101, 168),\n        \"C-term disordered (126-168)\": range(126, 169)\n    }\n    for name, rng in regions.items():\n        region_plddt = [residue_plddt.get(r, 0) for r in rng if r in residue_plddt]\n        if region_plddt:\n            print(f\"  {name}: {np.mean(region_plddt):.1f}\")\n    \n    # Plot pLDDT profile\n    import matplotlib.pyplot as plt\n    fig, ax = plt.subplots(figsize=(12, 4))\n    resnums = sorted(residue_plddt.keys())\n    plddts = [residue_plddt[r] for r in resnums]\n    \n    ax.plot(resnums, plddts, 'b-', linewidth=1.5)\n    ax.fill_between(resnums, plddts, alpha=0.3)\n    ax.set_xlabel('Residue number')\n    ax.set_ylabel('pLDDT score')\n    ax.set_title('AlphaFold pLDDT confidence for tam10 (G2TRQ9)')\n    ax.set_ylim(0, 100)\n    ax.axhline(y=70, color='orange', linestyle='--', alpha=0.5, label='Confident threshold')\n    ax.axhline(y=50, color='red', linestyle='--', alpha=0.5, label='Low confidence threshold')\n    \n    # Annotate regions\n    ax.axvspan(101, 167, alpha=0.1, color='green', label='SMAP domain')\n    ax.axvspan(35, 95, alpha=0.1, color='blue', label='Coiled-coil')\n    \n    ax.legend(fontsize=8)\n    plt.tight_layout()\n    plt.savefig('tam10_plddt.png', dpi=150)\n    plt.show()\n    print(\"\\nPlot saved: tam10_plddt.png\")\nelse:\n    print(f\"Failed to download AlphaFold PDB: {response.status_code}\")\n"
}