pdblisted
Install: claude install-skill BioTender-max/awesome-bio-agent-skills
# PDB Database Access
**Note**: This skill uses the RCSB PDB web API directly. No Modal deployment needed - all operations run locally via HTTP requests.
## Fetching Structures
### By PDB ID
```bash
# Download PDB file
curl -o 1alu.pdb "https://files.rcsb.org/download/1ALU.pdb"
# Download mmCIF
curl -o 1alu.cif "https://files.rcsb.org/download/1ALU.cif"
```
### Using Python
```python
from Bio.PDB import PDBList
pdbl = PDBList()
pdbl.retrieve_pdb_file("1ABC", pdir="structures/", file_format="pdb")
```
### Using RCSB API
```python
import requests
def fetch_pdb(pdb_id: str, format: str = "pdb") -> str:
"""Fetch structure from RCSB PDB."""
url = f"https://files.rcsb.org/download/{pdb_id}.{format}"
response = requests.get(url)
response.raise_for_status()
return response.text
def fetch_fasta(pdb_id: str) -> str:
"""Fetch sequence in FASTA format."""
url = f"https://www.rcsb.org/fasta/entry/{pdb_id}"
return requests.get(url).text
# Example usage
pdb_content = fetch_pdb("1ALU")
with open("1ALU.pdb", "w") as f:
f.write(pdb_content)
```
## Structure Preparation
### Selecting Chains
```python
from Bio.PDB import PDBParser, PDBIO, Select
class ChainSelect(Select):
def __init__(self, chain_id):
self.chain_id = chain_id
def accept_chain(self, chain):
return chain.id == self.chain_id
# Extract chain A
parser = PDBParser()
structure = parser.get_structure("protein", "1abc.pdb")
io = PDBIO()
io.set_structure(structure)