PDB Chain Extractor¶
Extracts one or more specified chains from input PDB structures and returns a new PDB containing only those chains. Chain selection is case-insensitive, whitespace-tolerant, and validated to single alphanumeric IDs. Non-coordinate records such as headers and secondary structure annotations are preserved; only ATOM/HETATM for the selected chains are retained.

Usage¶
Use this node when you need to isolate specific chains from multi-chain PDB structures before downstream analysis, visualization, conversion, or modeling. Typical workflow: load or batch PDBs → PDB Chain Extractor (specify chain IDs like A,B) → pass filtered PDBs to visualization, conversion (e.g., CIF), or modeling nodes.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| pdb | True | PDB | Input PDB structure(s) as a dictionary mapping {pdb_id: pdb_content}. Each value should be a valid PDB-formatted string. | {"1ABC": "HEADER ...\nATOM ...\nHETATM ...\nEND"} |
| chains | True | STRING | Comma-separated list of chain IDs to extract. Accepts formats like "A", "A,B", "A, B", or with extra spaces; spaces are ignored. Chain IDs are treated case-insensitively and must be single alphanumeric characters. | A,B |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| filtered_pdb | PDB | Dictionary {pdb_id: pdb_content} where each PDB contains only the specified chains. Preserves header/annotation records and includes ATOM/HETATM only for selected chains. | {"1ABC": "HEADER ...\nATOM ... (only chains A/B)\nEND"} |
Important Notes¶
- Chain IDs must be single alphanumeric characters; invalid IDs cause an error.
- The chains parameter cannot be empty; at least one valid chain must be provided.
- Selection is case-insensitive and ignores spaces around commas.
- If a requested chain is not found, the node raises an error listing available chains discovered in the input.
- Only ATOM/HETATM records for the specified chains are kept; many header and annotation records (e.g., HEADER, TITLE, HELIX, SHEET) are preserved; END is appended.
- Input must be a PDB dictionary {pdb_id: pdb_string}. Empty PDB content entries are skipped with a warning.
- If no valid PDBs remain after processing, the node raises an error.
Troubleshooting¶
- No atoms found for chains: Ensure the requested chain IDs exist in the input PDB. The error message lists available chains detected; adjust the 'chains' input accordingly.
- Invalid chain ID: Chain IDs must be single alphanumeric characters (e.g., A, B, 1). Remove multi-character or special-character IDs.
- Empty 'chains' input: Provide at least one chain (e.g., A or A,B). Spaces are allowed around commas.
- Output is empty or node errors with 'No valid PDB structures could be processed': Verify that the input PDB dictionary contains non-empty, valid PDB strings.
- Unexpected case or whitespace issues: The node ignores spaces and is case-insensitive, but ensure commas separate chain IDs (e.g., A, B, not A;B).