molecular-format-conversion

Convert between molecular formats including SMILES, InChI, InChIKey, and SELFIES for cheminformatics applications.

Best use case

molecular-format-conversion is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Convert between molecular formats including SMILES, InChI, InChIKey, and SELFIES for cheminformatics applications.

Teams using molecular-format-conversion should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/molecular-format-conversion/SKILL.md --create-dirs "https://raw.githubusercontent.com/SpectrAI-Initiative/InnoClaw/main/.claude/skills/molecular-format-conversion/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/molecular-format-conversion/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How molecular-format-conversion Compares

Feature / Agentmolecular-format-conversionStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Convert between molecular formats including SMILES, InChI, InChIKey, and SELFIES for cheminformatics applications.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Molecular Format Conversion

## Usage

### 1. MCP Server Definition

Use the same `ChemicalToolsClient` class as defined in the molecular-properties-calculation skill.

### 2. Molecular Format Conversion Workflow

This workflow converts molecules between different chemical formats (SMILES, InChI, SELFIES) for database searching, machine learning, and cheminformatics applications.

**Workflow Steps:**

1. **SMILES to InChI** - Convert SMILES to International Chemical Identifier
2. **InChI to SMILES** - Convert InChI back to SMILES
3. **SMILES to SELFIES** - Convert to string-based molecular representation

**Implementation:**

```python
## Initialize client
HEADERS = {"SCP-HUB-API-KEY": "<your-api-key>"}

client = ChemicalToolsClient(
    "https://scp.intern-ai.org.cn/api/v1/mcp/31/SciToolAgent-Chem",
    HEADERS
)

if not await client.connect():
    print("connection failed")
    exit()

print("=== Molecular Format Conversion ===\n")

## Test molecules
smiles = "CCO"  # Ethanol
inchi = "InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3"

## Step 1: SMILES to InChI
print("Step 1: SMILES to InChI")
result = await client.client.call_tool(
    "SMILESToInChI",
    arguments={"smiles": smiles}
)
result_data = client.parse_result(result)
print(f"SMILES: {smiles}")
print(f"{result_data}\n")

## Step 2: InChI to SMILES
print("Step 2: InChI to SMILES")
result = await client.client.call_tool(
    "InChIToSMILES",
    arguments={"inchi": inchi}
)
result_data = client.parse_result(result)
print(f"InChI: {inchi}")
print(f"{result_data}\n")

## Step 3: SMILES to SELFIES
print("Step 3: SMILES to SELFIES")
result = await client.client.call_tool(
    "SMILEStoSELFIES",
    arguments={"smiles": smiles}
)
result_data = client.parse_result(result)
print(f"SMILES: {smiles}")
print(f"{result_data}\n")

## Step 4: SELFIES to SMILES
print("Step 4: SELFIES to SMILES")
selfies = "[C][C][O]"
result = await client.client.call_tool(
    "SELFIEStoSMILES",
    arguments={"selfies": selfies}
)
result_data = client.parse_result(result)
print(f"SELFIES: {selfies}")
print(f"{result_data}\n")

await client.disconnect()
```

### Tool Descriptions

**SciToolAgent-Chem Server:**
- `SMILESToInChI`: Convert SMILES to InChI
  - Args: `smiles` (str)
  - Returns: InChI string

- `InChIToSMILES`: Convert InChI to SMILES
  - Args: `inchi` (str)
  - Returns: SMILES string

- `SMILEStoSELFIES`: Convert SMILES to SELFIES
  - Args: `smiles` (str)
  - Returns: SELFIES string

- `SELFIEStoSMILES`: Convert SELFIES to SMILES
  - Args: `selfies` (str)
  - Returns: SMILES string

- `InChIToInChIKey`: Convert InChI to InChIKey
  - Args: `inchi` (str)
  - Returns: InChIKey (27-character hash)

- `InChIKeyToInChI`: Convert InChIKey to InChI
  - Args: `inchikey` (str)
  - Returns: InChI string

### Input/Output

**Input:**
- **SMILES**: Simplified Molecular Input Line Entry System (e.g., "CCO")
- **InChI**: IUPAC International Chemical Identifier (e.g., "InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3")
- **InChIKey**: Hashed InChI (27 characters, e.g., "LFQSCWFLJHTTHZ-UHFFFAOYSA-N")
- **SELFIES**: Self-Referencing Embedded Strings (e.g., "[C][C][O]")

**Output:**
- Converted molecular representation in target format

### Format Comparison

| Format | Canonical | Human-Readable | Database-Friendly | ML-Friendly |
|--------|-----------|----------------|-------------------|-------------|
| SMILES | Partial | High | Medium | Medium |
| InChI | Yes | Low | High | Low |
| InChIKey | Yes | No | Very High | No |
| SELFIES | Yes | Low | Low | Very High |

### Use Cases

- **SMILES**: Standard format for most cheminformatics tools
- **InChI**: Canonical representation for database searching
- **InChIKey**: Fast database lookups and duplicate detection
- **SELFIES**: Machine learning models (guarantees valid molecules)

### Format Details

**SMILES (Simplified Molecular Input Line Entry System)**
- Pros: Human-readable, widely supported
- Cons: Not canonical (multiple SMILES for same molecule)
- Example: "CCO", "c1ccccc1", "CC(=O)O"

**InChI (International Chemical Identifier)**
- Pros: Canonical, includes stereochemistry and isotopes
- Cons: Long, not human-readable
- Example: "InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3"

**InChIKey**
- Pros: Fixed-length hash, fast comparison
- Cons: Cannot reconstruct molecule from key
- Example: "LFQSCWFLJHTTHZ-UHFFFAOYSA-N"
- Structure: 14 characters (connectivity) + separator + 8 characters (stereo) + separator + version

**SELFIES (Self-Referencing Embedded Strings)**
- Pros: Always generates valid molecules, ideal for ML
- Cons: Less human-readable, newer format
- Example: "[C][C][O]"
- Used in: Generative models, molecular optimization

### Additional Conversion Tools

- `ConvertSmilesToInchi`: Alternative SMILES to InChI converter
- `GenerateMolKeyFromSmiles`: Generate molecular key
- `InChIKeyToMOL`: Convert InChIKey to MOL file
- `IsValidInChIKey`: Validate InChIKey format

### Error Handling

Some conversions may fail for:
- Invalid input formats
- Unsupported chemical features
- Very large or complex molecules

Always check for errors in the returned data.

Related Skills

unit_conversion_suite

370
from SpectrAI-Initiative/InnoClaw

Multi-Unit Conversion Suite - Convert units across domains: length mm to m, radius m to cm, dimensions to meters, nm to um, volume to cm3. Use this skill for metrology tasks involving convert length mm to m convert radius m to cm convert dimensions to meters convert nm to um convert volume to cm3. Combines 5 tools from 1 SCP server(s).

unit-conversion-nanoscale

370
from SpectrAI-Initiative/InnoClaw

Convert physical quantities and units at nanoscale for materials science and nanotechnology applications.

smiles-to-cas-conversion

370
from SpectrAI-Initiative/InnoClaw

Convert SMILES strings to CAS registry numbers using material informatics tools to identify chemical substances.

molecular_visualization_suite

370
from SpectrAI-Initiative/InnoClaw

Molecular Visualization Suite - Visualize molecules: convert SMILES to formats, visualize molecule, visualize protein, visualize complex. Use this skill for chemical visualization tasks involving convert smiles to format visualize molecule visualize protein visualize complex. Combines 4 tools from 1 SCP server(s).

molecular_fingerprint_analysis

370
from SpectrAI-Initiative/InnoClaw

Molecular Fingerprint Analysis - Fingerprint analysis: topology descriptors, structure complexity, similarity calculation, and AromaticityAnalysis. Use this skill for cheminformatics tasks involving calculate mol topology calculate mol structure complexity calculate smiles similarity AromaticityAnalyzer. Combines 4 tools from 2 SCP server(s).

molecular_docking_pipeline

370
from SpectrAI-Initiative/InnoClaw

Molecular Docking Pipeline - Complete docking workflow: retrieve protein structure, predict binding pockets, prepare receptor, and dock ligand. Use this skill for structural biology tasks involving retrieve protein data by pdbcode run fpocket convert pdb to pdbqt dock quick molecule docking. Combines 4 tools from 2 SCP server(s).

molecular-similarity-search

370
from SpectrAI-Initiative/InnoClaw

Search for similar molecules using Tanimoto similarity with Morgan fingerprints to identify structurally related compounds.

molecular-property-profiling

370
from SpectrAI-Initiative/InnoClaw

Comprehensive molecular property analysis covering basic info, hydrophobicity, H-bonding, structural complexity, topology, drug-likeness, charge distribution, and complexity metrics.

molecular-properties-calculation

370
from SpectrAI-Initiative/InnoClaw

Calculate basic molecular properties from SMILES including molecular weight, formula, atom counts, and exact mass.

molecular-descriptors-calculation

370
from SpectrAI-Initiative/InnoClaw

Calculate advanced molecular descriptors including shape indices, connectivity indices, and structural features for QSAR and drug discovery.

energy_conversion

370
from SpectrAI-Initiative/InnoClaw

Energy Unit Conversion Pipeline - Convert between energy units and analyze: MeV to Joules, scientific notation, and error calculation. Use this skill for physics tasks involving convert energy MeV to J convert to scientific notation format scientific notation calculate absolute error. Combines 4 tools from 2 SCP server(s).

wind-site-assessment

370
from SpectrAI-Initiative/InnoClaw

Assess wind energy potential and perform site analysis using atmospheric science calculations.