[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EEHXEPR25JC1ENMMYQ15E9":3,"skill-same:01M7EEHXEPR25JC1ENMMYQ15E9":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EEHXEPR25JC1ENMMYQ15E9","bio-molecular-io",null,"Reads, writes, and converts molecular file formats (SMILES, InChI, SDF V2000\u002FV3000, MOL2, PDB, and BinaryCIF) using RDKit and Open Babel with rigorous handling of aromaticity perception, stereochemistry, implicit\u002Fexplicit hydrogens, kekulization, and salt\u002Ffragment separation. Use when loading chemical libraries, debugging parse failures, or preparing molecules for downstream standardization, descriptor calculation, or docking.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-molecular-io\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-molecular-io\ndescription: Reads, writes, and converts molecular file formats (SMILES, InChI, SDF V2000\u002FV3000, MOL2, PDB, and BinaryCIF) using RDKit and Open Babel with rigorous handling of aromaticity perception, stereochemistry, implicit\u002Fexplicit hydrogens, kekulization, and salt\u002Ffragment separation. Use when loading chemical libraries, debugging parse failures, or preparing molecules for downstream standardization, descriptor calculation, or docking.\ntool_type: python\nprimary_tool: RDKit\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"chemoinformatics\u002Fmolecular-io\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: RDKit 2024.09+, Open Babel 3.1.1+, ChEMBL structure_pipeline 1.2+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- CLI: `obabel -V`; `obabel -L formats`\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Molecular I\u002FO\n\nParse, write, and convert molecular file formats. Most downstream errors trace back to silent I\u002FO issues: incorrect aromaticity perception, lost stereochemistry, mishandled charges, dropped stereo bonds, or non-canonical tautomers. This skill enumerates each format's failure modes and prescribes the correct toolchain for each scenario.\n\nFor full standardization (canonicalization, salt stripping, tautomer enumeration) see `chemoinformatics\u002Fmolecular-standardization`. For generating 3D conformers from parsed 2D molecules, see `chemoinformatics\u002Fconformer-generation`.\n\n## Format Taxonomy\n\n| Format | Dim | Stereo | Charges | Strength | Fails when |\n|--------|-----|--------|---------|----------|------------|\n| SMILES | 2D | Atom chirality `@\u002F@@`; double-bond `\u002F` and `\\` | Atom-local formal charges | Compact, web-friendly, fast parse | Loses absolute coordinates; aromatic perception ambiguous across toolkits; tautomers not canonical |\n| InChI | 2D | `\u002Fb`, `\u002Ft`, `\u002Fm`, `\u002Fs` stereo sublayers | `\u002Fq` charge and `\u002Fp` added\u002Fremoved-proton sublayers; `\u002Fp` is not a pH model | Canonical by construction; cross-toolkit identity | Standard InChI normalizes mobile-H forms; limited organometallic stereo; large molecules may require special handling |\n| SDF V2000 | 2D\u002F3D | Wedge bonds | M CHG line | Industry default; metadata via tags | 999-atom limit; cannot encode multi-component reactions; query atoms ambiguous |\n| SDF V3000 | 2D\u002F3D | Wedge + stereo flag | Inline charge | No atom limit; query support; rich properties | Some software (legacy) cannot read; verbose |\n| MOL2 (Tripos) | 3D | Common records rely on 3D coordinates and toolkit perception; no portable explicit stereo field | Per-atom partial | SYBYL atom types preserved for docking | Atom-type dialects diverge (SYBYL vs Corina); RDKit MOL2 parser brittle |\n| PDB | 3D | None | None standard | Universal protein format | No bond orders; aromatic perception lost; ligand names truncated to 3 chars |\n| PDBQT | 3D | None | Gasteiger \u002F AD4 | AutoDock-ready; torsion tree encoded | Specific to docking; no aromaticity layer |\n| BinaryCIF (MMTF retired) | 3D | Encoded | Encoded | BinaryCIF (`.bcif`) is the current compact structural format; RCSB stopped serving MMTF files on July 2, 2024 and recommends BinaryCIF (RCSB PDB 2024) | Not all toolkits parse; binary format |\n| CDX\u002FCDXML | 2D | Drawing | Drawing | ChemDraw native | Not a structural format; converts unreliably |\n| InChIKey | Hash | Stereo layer | n\u002Fa | Database key, fast lookup | Collision probability depends on key block and collection size; cannot recover structure |\n\n## Aromaticity Perception (most common silent error)\n\nDifferent toolkits perceive aromaticity differently. The same SMILES round-tripped between toolkits may produce different canonical strings and different fingerprints.\n\n| Model | Toolkit | Rule | Symptom of mismatch |\n|-------|---------|------|---------------------|\n| Daylight | OpenEye, Daylight | 4n+2 π on planar ring | Furan, thiophene aromatic |\n| RDKit default | RDKit | Daylight-like with extensions for fused \u002F N-containing | Compatible with Daylight for drug-like molecules |\n| MDL | Available in several toolkits, including RDKit as `AROMATICITY_MDL` | Five-membered rings are not aromatic unless part of a fused aromatic system; only C\u002FN and one-electron donors qualify; exocyclic double bonds exclude an atom | Five-membered heteroaromatics and exocyclic-bond systems may differ from the default RDKit model |\n| OpenEye | OEAroModel | Several modes | Charged thiophene non-aromatic in MDL but aromatic in OpenEye |\n\n**Fix:** Always re-canonicalize via the toolkit doing analysis. If aromaticity must be reassigned explicitly in RDKit, use a concrete model, for example `Chem.SetAromaticity(mol, Chem.AromaticityModel.AROMATICITY_RDKIT)`, after the molecule is in an appropriate sanitized or kekulized state.\n\n## Stereochemistry Layers\n\nStereo loss is the second most common silent error. Each format encodes stereo differently:\n\n- SMILES: `@\u002F@@` for tetrahedral, `\u002F` and `\\` for cis\u002Ftrans double bonds\n- InChI: `\u002Fb` for double-bond stereo, `\u002Ft` for tetrahedral stereo, and `\u002Fm` plus `\u002Fs` for inversion\u002Foverall stereo type\n- SDF: wedge\u002Fhash bond + parity 0\u002F1\u002F2; cis\u002Ftrans encoded via bond direction\n- MOL2: common Tripos records provide 3D coordinates but no portable wedge or explicit stereo field; verify toolkit perception by round trip\n\n**Round-trip tests:** If `Chem.MolToSmiles(Chem.MolFromSmiles(smi), isomericSmiles=True)` does not preserve the represented stereochemistry, inspect whether the source contained stereo markers and whether any step called `Chem.RemoveStereochemistry()` or discarded stereochemical coordinates\u002Fbond directions. Sanitization alone does not intentionally remove valid stereochemistry. If `MolFromMolFile` returns a molecule missing wedge bonds, inspect the source's coordinates, bond directions, and parity encoding.\n\n## Reading SMILES with Stereo Preservation\n\n**Goal:** Parse SMILES while preserving stereo and aromatic-flag consistency.\n\n**Approach:** Use `Chem.MolFromSmiles(smi)` with sanitization on, verify with round-trip canonicalization, and set explicit stereochemistry where the toolkit's perception missed it.\n\n```python\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem\n\ndef parse_smiles_safe(smi):\n    mol = Chem.MolFromSmiles(smi)\n    if mol is None:\n        return None, 'parse_failure'\n    Chem.AssignStereochemistry(mol, cleanIt=True, force=True)\n    canon = Chem.MolToSmiles(mol)\n    round_trip = Chem.MolFromSmiles(canon)\n    if Chem.MolToSmiles(round_trip) != canon:\n        return mol, 'round_trip_unstable'\n    return mol, 'ok'\n```\n\n## Reading SDF with Property Carryover\n\n**Goal:** Load a multi-record SDF preserving per-molecule properties (Name, ID, IC50, etc.) used by downstream filtering and ML labeling.\n\n**Approach:** Iterate via `SDMolSupplier(removeHs=False, sanitize=True)`, filter `None` (parse failures), and capture properties via `mol.GetPropsAsDict()`.\n\n```python\nfrom rdkit import Chem\n\nsupplier = Chem.SDMolSupplier('library.sdf', removeHs=False, sanitize=True)\nmols = []\nfails = []\nfor i, mol in enumerate(supplier):\n    if mol is None:\n        fails.append(i)\n        continue\n    props = mol.GetPropsAsDict()\n    mols.append((mol, props))\nprint(f'parsed: {len(mols)}; failed: {len(fails)}')\n```\n\nIf a large fraction fails, try `sanitize=False` then `Chem.SanitizeMol(mol, catchErrors=True)` to identify per-step failures (kekulization, valence, aromaticity).\n\n## Open Babel for MOL2 \u002F PDBQT\n\nRDKit's MOL2 parser is incomplete (SYBYL atom-type sets differ). Open Babel is more robust for MOL2 and PDBQT.\n\n```python\nfrom openbabel import pybel\n\nmols = list(pybel.readfile('mol2', 'ligands.mol2'))\nfor mol in mols:\n    smi = mol.write('smi').strip().split()[0]\n    inchi = mol.write('inchi').strip()\n```\n\nFor docking output PDBQT, use Open Babel rather than RDKit:\n```python\nimport subprocess\nsubprocess.run(['obabel', 'docked.pdbqt', '-O', 'docked.sdf'], check=True)\n```\n\n## InChI for Canonical Identity\n\nInChI is a standardized, canonical structure identifier designed for cross-database and cross-toolkit interoperability (Heller et al. 2015; O'Boyle 2012). Standard InChI normalizes many mobile-hydrogen tautomers and has limitations for some metal stereochemistry; non-standard options such as `\u002FFixedH` can distinguish additional representations. InChIKey is a fixed-length hash, so use full InChI or standardized structures when a suspected collision must be resolved (InChI Trust technical FAQ).\n\n```python\nfrom rdkit.Chem.inchi import MolToInchi, MolToInchiKey, InchiToInchiKey\n\nmol = Chem.MolFromSmiles('c1ccc2c(c1)cccc2')\ninchi = MolToInchi(mol)\nkey = MolToInchiKey(mol)\n\ninchi_fixedH, aux_info = Chem.MolToInchiAndAuxInfo(mol, options='\u002FFixedH')\n```\n\n**Caveat:** Two molecules with identical std InChI may be different tautomers. Use `\u002FFixedH` for tautomer-distinguishing InChI when needed.\n\n## Per-Format Failure Modes\n\n### SMILES -- ambiguous aromaticity\n\n**Trigger:** Input from non-RDKit source (ChemAxon, OpenEye, Daylight) round-tripping into RDKit.\n\n**Mechanism:** RDKit perceives aromaticity on input. Aromatic flags from origin toolkit are overwritten.\n\n**Symptom:** Fingerprints differ between toolkits for \"identical\" molecules; database joins by canonical SMILES miss records.\n\n**Fix:** Always re-canonicalize within the analysis toolkit. For cross-toolkit identity, use InChIKey not canonical SMILES.\n\n### SDF V2000 -- atom count >999\n\n**Trigger:** Large molecules (peptides, oligonucleotides, dendrimers).\n\n**Mechanism:** V2000 header uses fixed 3-character atom count field.\n\n**Symptom:** Truncated atom block; parse failure with cryptic error.\n\n**Fix:** Switch to V3000. RDKit auto-detects V3000 on read; explicitly request it on the writer:\n\n```python\nwriter = Chem.SDWriter('out.sdf')\nwriter.SetForceV3000(True)\nwriter.write(mol)\nwriter.close()\n```\n\n### SDF -- wedge bond orientation lost\n\n**Trigger:** SDF written by tools that use parity flags only (older ISIS-Draw, some pipeline tools).\n\n**Mechanism:** Parity alone is ambiguous without geometric coordinates; RDKit reads parity but cannot re-render wedges.\n\n**Symptom:** Drawn molecule shows undefined stereo despite SDF carrying parity bits.\n\n**Fix:** After read, `Chem.AssignStereochemistryFrom3D(mol)` if 3D coords present; otherwise stereo must be re-derived from SMILES with wedges.\n\n### PDB ligand -- no bond orders\n\n**Trigger:** Parsing ligand from PDB entry (e.g., extracting co-crystal ligand).\n\n**Mechanism:** PDB stores only atoms + CONECT; bond orders inferred by RDKit's `AssignBondOrdersFromTemplate` which requires a template molecule.\n\n**Symptom:** All bonds single; aromatic rings non-aromatic; valences wrong.\n\n**Fix:** Use `AllChem.AssignBondOrdersFromTemplate(template, ligand)` where `template` is a SMILES-derived mol of the expected ligand structure. Or use the PDB Ligand Expo SDF.\n\n### MOL2 -- SYBYL atom type dialect\n\n**Trigger:** MOL2 produced by Corina, MOE, or Schrodinger.\n\n**Mechanism:** SYBYL atom types are not perfectly standardized across vendors; RDKit's parser handles canonical SYBYL.\n\n**Symptom:** Mol returns as `None` or with wrong atom types (`Cl` vs `Cl.O` peroxide-style).\n\n**Fix:** Convert via Open Babel as intermediate: `obabel input.mol2 -O temp.sdf` then read SDF.\n\n### Open Babel pybel -- import path\n\n**Trigger:** Code written for Open Babel 2.x.\n\n**Mechanism:** OB 3.x reorganized: `import pybel` no longer works.\n\n**Symptom:** `ModuleNotFoundError: No module named 'pybel'`.\n\n**Fix:** `from openbabel import pybel`.\n\n## Charge Models on I\u002FO\n\n| Source | Charges in file | Use for |\n|--------|-----------------|---------|\n| Parsed SMILES | Atom-local formal charges; no partial-charge model | Storage, similarity, ML training |\n| Parsed PDB | Atomic charges typically absent | Always re-assign for downstream |\n| `obabel --partialcharge gasteiger` | Gasteiger-Marsili partial charges (empirical) | Workflows that explicitly require Gasteiger charges; Vina\u002FVinardo scoring itself does not require assigned atom charges |\n| AM1-BCC (AmberTools antechamber) | Semi-empirical | MD, FEP setup |\n| RESP (psi4, Gaussian) | Restrained fit to a quantum-mechanical ESP; protocol-specific | Force-field workflows parameterized for that RESP protocol |\n\nThe charge model **must** match the downstream method. Mixing AM1-BCC ligand charges with TIP3P water + AMBER protein is valid; Gasteiger charges are unsuitable for MD.\n\n## Drawing for QC\n\nAlways draw a random subset of parsed molecules. Wrong stereo, missing rings, and broken aromaticity show immediately.\n\n```python\nfrom rdkit.Chem.Draw import rdMolDraw2D\n\ndef draw_grid(mols, fname, mols_per_row=5, sub_img_size=(250, 200)):\n    from rdkit.Chem.Draw import MolsToGridImage\n    img = MolsToGridImage(mols[:25], molsPerRow=mols_per_row, subImgSize=sub_img_size,\n                          legends=[m.GetProp('_Name') if m.HasProp('_Name') else ''\n                                   for m in mols[:25]])\n    img.save(fname)\n```\n\n`MolsToGridImage` returns PIL image; for headless servers use `MolDraw2DCairo` directly.\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `Chem.MolFromSmiles` returns None | Invalid SMILES, bad parentheses, ring not closed | Try `sanitize=False`, inspect with `Chem.MolFromSmiles(smi, sanitize=False)` |\n| Round-trip SMILES changes | Aromaticity perception drift | Always canonicalize within analysis toolkit |\n| All bonds single in PDB ligand | PDB has no bond orders | `AllChem.AssignBondOrdersFromTemplate(template, mol)` |\n| Stereo lost on SDF write | Stereo was absent, removed, or not represented by coordinates\u002Fbond directions | Verify assigned chiral tags and bond stereo before writing; preserve suitable 2D\u002F3D coordinates and inspect the round trip |\n| MOL2 parse returns None | RDKit MOL2 parser incomplete for vendor dialects | Convert via Open Babel intermediate |\n| InChI differs for \"same\" molecule | Different tautomers, charges, or stereo | Use `\u002FFixedH` to retain tautomer; compare without standardization |\n| Fingerprints differ across toolkits | Aromaticity model difference | Use InChIKey for identity; re-canonicalize for similarity |\n\n## References\n\n- Heller et al., *J. Cheminformatics* 7:23 (2015) -- InChI design, layout, and algorithms; software version 1.04. https:\u002F\u002Fdoi.org\u002F10.1186\u002Fs13321-015-0068-4\n- O'Boyle, *J. Cheminformatics* 4:22 (2012) -- Universal SMILES representation based on InChI. https:\u002F\u002Fdoi.org\u002F10.1186\u002F1758-2946-4-22\n- InChI Trust, \"Technical FAQ\" -- InChIKey layout and collision estimates. https:\u002F\u002Fwww.inchi-trust.org\u002Ftechnical-faq\u002F\n- Daylight Chemical Information Systems, SMILES theory -- atom-local formal-charge and stereochemical syntax. https:\u002F\u002Fwww.daylight.com\u002Fdayhtml\u002Fdoc\u002Ftheory\u002Ftheory.smiles.html\n- RDKit Book, \"Aromaticity\" -- RDKit and MDL aromaticity-model rules. https:\u002F\u002Fwww.rdkit.org\u002Fdocs\u002FRDKit_Book.html#aromaticity\n- RCSB PDB (2024), \"Removal of MMTF files from RCSB PDB.\" https:\u002F\u002Fwww.rcsb.org\u002Fnews\u002F6661c73362451e4e35915f7b\n\n## Related Skills\n\n- chemoinformatics\u002Fmolecular-standardization - Salt stripping, tautomer canonicalization, neutralization\n- chemoinformatics\u002Fmolecular-descriptors - Calculate fingerprints and properties from parsed molecules\n- chemoinformatics\u002Fconformer-generation - Generate 3D coordinates from 2D inputs\n- chemoinformatics\u002Fvirtual-screening - Prepare ligands for docking\n- structural-biology\u002Fstructure-io - Protein structure handling (PDB, mmCIF)\n","## Version Compatibility\n\nReference examples tested with: RDKit 2024.09+, Open Babel 3.1.1+, ChEMBL structure_pipeline 1.2+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- CLI: `obabel -V`; `obabel -L formats`\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Molecular I\u002FO\n\nParse, write, and convert molecular file formats. Most downstream errors trace back to silent I\u002FO issues: incorrect aromaticity perception, lost stereochemistry, mishandled charges, dropped stereo bonds, or non-canonical tautomers. This skill enumerates each format's failure modes and prescribes the correct toolchain for each scenario.\n\nFor full standardization (canonicalization, salt stripping, tautomer enumeration) see `chemoinformatics\u002Fmolecular-standardization`. For generating 3D conformers from parsed 2D molecules, see `chemoinformatics\u002Fconformer-generation`.\n\n## Format Taxonomy\n\n| Format | Dim | Stereo | Charges | Strength | Fails when |\n|--------|-----|--------|---------|----------|------------|\n| SMILES | 2D | Atom chirality `@\u002F@@`; double-bond `\u002F` and `\\` | Atom-local formal charges | Compact, web-friendly, fast parse | Loses absolute coordinates; aromatic perception ambiguous across toolkits; tautomers not canonical |\n| InChI | 2D | `\u002Fb`, `\u002Ft`, `\u002Fm`, `\u002Fs` stereo sublayers | `\u002Fq` charge and `\u002Fp` added\u002Fremoved-proton sublayers; `\u002Fp` is not a pH model | Canonical by construction; cross-toolkit identity | Standard InChI normalizes mobile-H forms; limited organometallic stereo; large molecules may require special handling |\n| SDF V2000 | 2D\u002F3D | Wedge bonds | M CHG line | Industry default; metadata via tags | 999-atom limit; cannot encode multi-component reactions; query atoms ambiguous |\n| SDF V3000 | 2D\u002F3D | Wedge + stereo flag | Inline charge | No atom limit; query support; rich properties | Some software (legacy) cannot read; verbose |\n| MOL2 (Tripos) | 3D | Common records rely on 3D coordinates and toolkit perception; no portable explicit stereo field | Per-atom partial | SYBYL atom types preserved for docking | Atom-type dialects diverge (SYBYL vs Corina); RDKit MOL2 parser brittle |\n| PDB | 3D | None | None standard | Universal protein format | No bond orders; aromatic perception lost; ligand names truncated to 3 chars |\n| PDBQT | 3D | None | Gasteiger \u002F AD4 | AutoDock-ready; torsion tree encoded | Specific to docking; no aromaticity layer |\n| BinaryCIF (MMTF retired) | 3D | Encoded | Encoded | BinaryCIF (`.bcif`) is the current compact structural format; RCSB stopped serving MMTF files on July 2, 2024 and recommends BinaryCIF (RCSB PDB 2024) | Not all toolkits parse; binary format |\n| CDX\u002FCDXML | 2D | Drawing | Drawing | ChemDraw native | Not a structural format; converts unreliably |\n| InChIKey | Hash | Stereo layer | n\u002Fa | Database key, fast lookup | Collision probability depends on key block and collection size; cannot recover structure |\n\n## Aromaticity Perception (most common silent error)\n\nDifferent toolkits perceive aromaticity differently. The same SMILES round-tripped between toolkits may produce different canonical strings and different fingerprints.\n\n| Model | Toolkit | Rule | Symptom of mismatch |\n|-------|---------|------|---------------------|\n| Daylight | OpenEye, Daylight | 4n+2 π on planar ring | Furan, thiophene aromatic |\n| RDKit default | RDKit | Daylight-like with extensions for fused \u002F N-containing | Compatible with Daylight for drug-like molecules |\n| MDL | Available in several toolkits, including RDKit as `AROMATICITY_MDL` | Five-membered rings are not aromatic unless part of a fused aromatic system; only C\u002FN and one-electron donors qualify; exocyclic double bonds exclude an atom | Five-membered heteroaromatics and exocyclic-bond systems may differ from the default RDKit model |\n| OpenEye | OEAroModel | Several modes | Charged thiophene non-aromatic in MDL but aromatic in OpenEye |\n\n**Fix:** Always re-canonicalize via the toolkit doing analysis. If aromaticity must be reassigned explicitly in RDKit, use a concrete model, for example `Chem.SetAromaticity(mol, Chem.AromaticityModel.AROMATICITY_RDKIT)`, after the molecule is in an appropriate sanitized or kekulized state.\n\n## Stereochemistry Layers\n\nStereo loss is the second most common silent error. Each format encodes stereo differently:\n\n- SMILES: `@\u002F@@` for tetrahedral, `\u002F` and `\\` for cis\u002Ftrans double bonds\n- InChI: `\u002Fb` for double-bond stereo, `\u002Ft` for tetrahedral stereo, and `\u002Fm` plus `\u002Fs` for inversion\u002Foverall stereo type\n- SDF: wedge\u002Fhash bond + parity 0\u002F1\u002F2; cis\u002Ftrans encoded via bond direction\n- MOL2: common Tripos records provide 3D coordinates but no portable wedge or explicit stereo field; verify toolkit perception by round trip\n\n**Round-trip tests:** If `Chem.MolToSmiles(Chem.MolFromSmiles(smi), isomericSmiles=True)` does not preserve the represented stereochemistry, inspect whether the source contained stereo markers and whether any step called `Chem.RemoveStereochemistry()` or discarded stereochemical coordinates\u002Fbond directions. Sanitization alone does not intentionally remove valid stereochemistry. If `MolFromMolFile` returns a molecule missing wedge bonds, inspect the source's coordinates, bond directions, and parity encoding.\n\n## Reading SMILES with Stereo Preservation\n\n**Goal:** Parse SMILES while preserving stereo and aromatic-flag consistency.\n\n**Approach:** Use `Chem.MolFromSmiles(smi)` with sanitization on, verify with round-trip canonicalization, and set explicit stereochemistry where the toolkit's perception missed it.\n\n```python\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem\n\ndef parse_smiles_safe(smi):\n    mol = Chem.MolFromSmiles(smi)\n    if mol is None:\n        return None, 'parse_failure'\n    Chem.AssignStereochemistry(mol, cleanIt=True, force=True)\n    canon = Chem.MolToSmiles(mol)\n    round_trip = Chem.MolFromSmiles(canon)\n    if Chem.MolToSmiles(round_trip) != canon:\n        return mol, 'round_trip_unstable'\n    return mol, 'ok'\n```\n\n## Reading SDF with Property Carryover\n\n**Goal:** Load a multi-record SDF preserving per-molecule properties (Name, ID, IC50, etc.) used by downstream filtering and ML labeling.\n\n**Approach:** Iterate via `SDMolSupplier(removeHs=False, sanitize=True)`, filter `None` (parse failures), and capture properties via `mol.GetPropsAsDict()`.\n\n```python\nfrom rdkit import Chem\n\nsupplier = Chem.SDMolSupplier('library.sdf', removeHs=False, sanitize=True)\nmols = []\nfails = []\nfor i, mol in enumerate(supplier):\n    if mol is None:\n        fails.append(i)\n        continue\n    props = mol.GetPropsAsDict()\n    mols.append((mol, props))\nprint(f'parsed: {len(mols)}; failed: {len(fails)}')\n```\n\nIf a large fraction fails, try `sanitize=False` then `Chem.SanitizeMol(mol, catchErrors=True)` to identify per-step failures (kekulization, valence, aromaticity).\n\n## Open Babel for MOL2 \u002F PDBQT\n\nRDKit's MOL2 parser is incomplete (SYBYL atom-type sets differ). Open Babel is more robust for MOL2 and PDBQT.\n\n```python\nfrom openbabel import pybel\n\nmols = list(pybel.readfile('mol2', 'ligands.mol2'))\nfor mol in mols:\n    smi = mol.write('smi').strip().split()[0]\n    inchi = mol.write('inchi').strip()\n```\n\nFor docking output PDBQT, use Open Babel rather than RDKit:\n```python\nimport subprocess\nsubprocess.run(['obabel', 'docked.pdbqt', '-O', 'docked.sdf'], check=True)\n```\n\n## InChI for Canonical Identity\n\nInChI is a standardized, canonical structure identifier designed for cross-database and cross-toolkit interoperability (Heller et al. 2015; O'Boyle 2012). Standard InChI normalizes many mobile-hydrogen tautomers and has limitations for some metal stereochemistry; non-standard options such as `\u002FFixedH` can distinguish additional representations. InChIKey is a fixed-length hash, so use full InChI or standardized structures when a suspected collision must be resolved (InChI Trust technical FAQ).\n\n```python\nfrom rdkit.Chem.inchi import MolToInchi, MolToInchiKey, InchiToInchiKey\n\nmol = Chem.MolFromSmiles('c1ccc2c(c1)cccc2')\ninchi = MolToInchi(mol)\nkey = MolToInchiKey(mol)\n\ninchi_fixedH, aux_info = Chem.MolToInchiAndAuxInfo(mol, options='\u002FFixedH')\n```\n\n**Caveat:** Two molecules with identical std InChI may be different tautomers. Use `\u002FFixedH` for tautomer-distinguishing InChI when needed.\n\n## Per-Format Failure Modes\n\n### SMILES -- ambiguous aromaticity\n\n**Trigger:** Input from non-RDKit source (ChemAxon, OpenEye, Daylight) round-tripping into RDKit.\n\n**Mechanism:** RDKit perceives aromaticity on input. Aromatic flags from origin toolkit are overwritten.\n\n**Symptom:** Fingerprints differ between toolkits for \"identical\" molecules; database joins by canonical SMILES miss records.\n\n**Fix:** Always re-canonicalize within the analysis toolkit. For cross-toolkit identity, use InChIKey not canonical SMILES.\n\n### SDF V2000 -- atom count >999\n\n**Trigger:** Large molecules (peptides, oligonucleotides, dendrimers).\n\n**Mechanism:** V2000 header uses fixed 3-character atom count field.\n\n**Symptom:** Truncated atom block; parse failure with cryptic error.\n\n**Fix:** Switch to V3000. RDKit auto-detects V3000 on read; explicitly request it on the writer:\n\n```python\nwriter = Chem.SDWriter('out.sdf')\nwriter.SetForceV3000(True)\nwriter.write(mol)\nwriter.close()\n```\n\n### SDF -- wedge bond orientation lost\n\n**Trigger:** SDF written by tools that use parity flags only (older ISIS-Draw, some pipeline tools).\n\n**Mechanism:** Parity alone is ambiguous without geometric coordinates; RDKit reads parity but cannot re-render wedges.\n\n**Symptom:** Drawn molecule shows undefined stereo despite SDF carrying parity bits.\n\n**Fix:** After read, `Chem.AssignStereochemistryFrom3D(mol)` if 3D coords present; otherwise stereo must be re-derived from SMILES with wedges.\n\n### PDB ligand -- no bond orders\n\n**Trigger:** Parsing ligand from PDB entry (e.g., extracting co-crystal ligand).\n\n**Mechanism:** PDB stores only atoms + CONECT; bond orders inferred by RDKit's `AssignBondOrdersFromTemplate` which requires a template molecule.\n\n**Symptom:** All bonds single; aromatic rings non-aromatic; valences wrong.\n\n**Fix:** Use `AllChem.AssignBondOrdersFromTemplate(template, ligand)` where `template` is a SMILES-derived mol of the expected ligand structure. Or use the PDB Ligand Expo SDF.\n\n### MOL2 -- SYBYL atom type dialect\n\n**Trigger:** MOL2 produced by Corina, MOE, or Schrodinger.\n\n**Mechanism:** SYBYL atom types are not perfectly standardized across vendors; RDKit's parser handles canonical SYBYL.\n\n**Symptom:** Mol returns as `None` or with wrong atom types (`Cl` vs `Cl.O` peroxide-style).\n\n**Fix:** Convert via Open Babel as intermediate: `obabel input.mol2 -O temp.sdf` then read SDF.\n\n### Open Babel pybel -- import path\n\n**Trigger:** Code written for Open Babel 2.x.\n\n**Mechanism:** OB 3.x reorganized: `import pybel` no longer works.\n\n**Symptom:** `ModuleNotFoundError: No module named 'pybel'`.\n\n**Fix:** `from openbabel import pybel`.\n\n## Charge Models on I\u002FO\n\n| Source | Charges in file | Use for |\n|--------|-----------------|---------|\n| Parsed SMILES | Atom-local formal charges; no partial-charge model | Storage, similarity, ML training |\n| Parsed PDB | Atomic charges typically absent | Always re-assign for downstream |\n| `obabel --partialcharge gasteiger` | Gasteiger-Marsili partial charges (empirical) | Workflows that explicitly require Gasteiger charges; Vina\u002FVinardo scoring itself does not require assigned atom charges |\n| AM1-BCC (AmberTools antechamber) | Semi-empirical | MD, FEP setup |\n| RESP (psi4, Gaussian) | Restrained fit to a quantum-mechanical ESP; protocol-specific | Force-field workflows parameterized for that RESP protocol |\n\nThe charge model **must** match the downstream method. Mixing AM1-BCC ligand charges with TIP3P water + AMBER protein is valid; Gasteiger charges are unsuitable for MD.\n\n## Drawing for QC\n\nAlways draw a random subset of parsed molecules. Wrong stereo, missing rings, and broken aromaticity show immediately.\n\n```python\nfrom rdkit.Chem.Draw import rdMolDraw2D\n\ndef draw_grid(mols, fname, mols_per_row=5, sub_img_size=(250, 200)):\n    from rdkit.Chem.Draw import MolsToGridImage\n    img = MolsToGridImage(mols[:25], molsPerRow=mols_per_row, subImgSize=sub_img_size,\n                          legends=[m.GetProp('_Name') if m.HasProp('_Name') else ''\n                                   for m in mols[:25]])\n    img.save(fname)\n```\n\n`MolsToGridImage` returns PIL image; for headless servers use `MolDraw2DCairo` directly.\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `Chem.MolFromSmiles` returns None | Invalid SMILES, bad parentheses, ring not closed | Try `sanitize=False`, inspect with `Chem.MolFromSmiles(smi, sanitize=False)` |\n| Round-trip SMILES changes | Aromaticity perception drift | Always canonicalize within analysis toolkit |\n| All bonds single in PDB ligand | PDB has no bond orders | `AllChem.AssignBondOrdersFromTemplate(template, mol)` |\n| Stereo lost on SDF write | Stereo was absent, removed, or not represented by coordinates\u002Fbond directions | Verify assigned chiral tags and bond stereo before writing; preserve suitable 2D\u002F3D coordinates and inspect the round trip |\n| MOL2 parse returns None | RDKit MOL2 parser incomplete for vendor dialects | Convert via Open Babel intermediate |\n| InChI differs for \"same\" molecule | Different tautomers, charges, or stereo | Use `\u002FFixedH` to retain tautomer; compare without standardization |\n| Fingerprints differ across toolkits | Aromaticity model difference | Use InChIKey for identity; re-canonicalize for similarity |\n\n## References\n\n- Heller et al., *J. Cheminformatics* 7:23 (2015) -- InChI design, layout, and algorithms; software version 1.04. https:\u002F\u002Fdoi.org\u002F10.1186\u002Fs13321-015-0068-4\n- O'Boyle, *J. Cheminformatics* 4:22 (2012) -- Universal SMILES representation based on InChI. https:\u002F\u002Fdoi.org\u002F10.1186\u002F1758-2946-4-22\n- InChI Trust, \"Technical FAQ\" -- InChIKey layout and collision estimates. https:\u002F\u002Fwww.inchi-trust.org\u002Ftechnical-faq\u002F\n- Daylight Chemical Information Systems, SMILES theory -- atom-local formal-charge and stereochemical syntax. https:\u002F\u002Fwww.daylight.com\u002Fdayhtml\u002Fdoc\u002Ftheory\u002Ftheory.smiles.html\n- RDKit Book, \"Aromaticity\" -- RDKit and MDL aromaticity-model rules. https:\u002F\u002Fwww.rdkit.org\u002Fdocs\u002FRDKit_Book.html#aromaticity\n- RCSB PDB (2024), \"Removal of MMTF files from RCSB PDB.\" https:\u002F\u002Fwww.rcsb.org\u002Fnews\u002F6661c73362451e4e35915f7b\n\n## Related Skills\n\n- chemoinformatics\u002Fmolecular-standardization - Salt stripping, tautomer canonicalization, neutralization\n- chemoinformatics\u002Fmolecular-descriptors - Calculate fingerprints and properties from parsed molecules\n- chemoinformatics\u002Fconformer-generation - Generate 3D coordinates from 2D inputs\n- chemoinformatics\u002Fvirtual-screening - Prepare ligands for docking\n- structural-biology\u002Fstructure-io - Protein structure handling (PDB, mmCIF)\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","chemoinformatics\u002Fmolecular-io\u002FSKILL.md","RDKit","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-molecular-io","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-molecular-io",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-molecular-io",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-molecular-io","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-molecular-io\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fmolecule_io.py","SCRIPT","脚本",4837,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-molecular-io\u002Fexamples\u002Fmolecule_io.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",2575,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-molecular-io\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]