COSMolKit Tools
Loading browser workspace
mmCIF to PDB converter
Convert mmCIF to PDB locally in your browser with COSMolKit, Rust, and WebAssembly.
Source
656 charactersConverted output
1 atoms / 0 bondsFormats available in this converter
COSMolKit reads and writes the molecular graph locally. Coordinate-dependent exports use the coordinates available in the source or generated by the selected workflow.
Input formats
SMILES; MOL or SDF V2000/V3000; Tripos MOL2; PDB; PDBx/mmCIF; XYZ.
Output formats
SMILES; MOL V2000/V3000; SDF V2000/V3000; PDB; SVG depiction.
Common molecular file conversions
Convert files to SMILES: SDF to SMILES, MOL to SMILES, MOL2 to SMILES, PDB to SMILES, mmCIF to SMILES, and XYZ to SMILES.
Export from SMILES: SMILES to SDF V2000/V3000, SMILES to MOL V2000/V3000, SMILES to PDB, and SMILES to SVG.
Convert molecular structure files: MOL2 to SDF, MOL2 to PDB, SDF to MOL, SDF to PDB, PDB to SDF, mmCIF to PDB, and XYZ to SDF.
Create a 2D structure image: Render SMILES, MOL, SDF, MOL2, PDB, mmCIF, or XYZ input as a scalable SVG molecular depiction.
Run the same conversion with COSMolKit
The example tracks the formats and source currently selected above.
pip install cosmolkit==0.3.0Python 3.9+ / Rust-native wheel
from pathlib import Path
from cosmolkit import Molecule
source = "data_water\nloop_\n_atom_site.group_PDB\n_atom_site.id\n_atom_site.type_symbol\n_atom_site.label_atom_id\n_atom_site.label_alt_id\n_atom_site.label_comp_id\n_atom_site.label_asym_id\n_atom_site.label_entity_id\n_atom_site.label_seq_id\n_atom_site.pdbx_PDB_ins_code\n_atom_site.Cartn_x\n_atom_site.Cartn_y\n_atom_site.Cartn_z\n_atom_site.occupancy\n_atom_site.B_iso_or_equiv\n_atom_site.auth_seq_id\n_atom_site.auth_comp_id\n_atom_site.auth_asym_id\n_atom_site.auth_atom_id\nHETATM 1 O O . HOH A 1 1 ? 0.000 0.000 0.000 1.00 20.00 1 HOH A O\nHETATM 2 H H1 . HOH A 1 1 ? 0.957 0.000 0.000 1.00 20.00 1 HOH A H1\nHETATM 3 H H2 . HOH A 1 1 ? -0.240 0.927 0.000 1.00 20.00 1 HOH A H2\n"
mol = Molecule.from_mmcif_block(source)
output = mol.to_pdb_block()
Path("molecule.pdb").write_text(output, encoding="utf-8")COSMolKit Tools
Loading browser workspace