Source: https://github.com/aipoch/medical-research-skills
SMILES De-salter
ID: 176
Batch process chemical structure strings, removing salt ion portions and retaining only the active core.
When to Use
- Use this skill when the task needs Batch process chemical SMILES strings to remove salt ions and retain.
- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
Key Features
- Scope-focused workflow aligned to: Analyze data with
smiles-de-salter using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.
- Packaged executable path(s):
scripts/main.py.
- Reference material available in
references/ for task-specific guidance.
- Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
- Python >= 3.8
- rdkit >= 2022.03.1
Example Usage
See ## Usage above for related details.
cd "20260318/scientific-skills/Data Analytics/smiles-de-salter"
python -m py_compile scripts/main.py
python scripts/main.py --help
Example run plan:
- Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings.
- Run
python scripts/main.py with the validated inputs.
- Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
See ## Workflow above for related details.
- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/main.py.
- Reference guidance:
references/ contains supporting rules, prompts, or checklists.
- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan."
Workflow
- Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Function Description
This Skill is used to process chemical SMILES strings, automatically identifying and removing counterions, retaining only the active pharmaceutical ingredient (API).
Salt Ion Identification Rules
- Identify multiple components through
. separator
- Salt ions are usually smaller ions (such as Na⁺, Cl⁻, K⁺, Br⁻, etc.)
- Retain the component with the most atoms as the core
- Support common inorganic salts and organic acid salts
Supported Salt Types
| Type |
Examples |
| Inorganic salts |
NaCl, KCl, HCl, H₂SO₄ |
| Organic acid salts |
Citrate, Tartrate, Maleate |
| Quaternary ammonium salts |
Various quaternary ammonium compounds |
Usage
Command Line
python -m py_compile scripts/main.py
# Example invocation: python scripts/main.py -i input.csv -o output.csv -c smiles_column
Parameter Description
| Parameter |
Short |
Description |
Default |
--input |
-i |
Input file path (CSV/TSV/SMILES) |
Required |
--output |
-o |
Output file path |
desalted_output.csv |
--column |
-c |
SMILES column name |
smiles |
--keep-largest |
-k |
Keep largest component (by atom count) |
True |
Single Processing Example
python scripts/main.py -s "CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C.[Na+]"
# Output: CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C
Input Format
CSV/TSV Files
id,smiles,name
1,CCO.[Na+],ethanol_sodium
2,c1ccccc1.[Cl-],benzene_hcl
Pure SMILES Files
One SMILES string per line:
CCO.[Na+]
c1ccccc1.[Cl-]
Output Format
Output file contains original data and new processing result columns:
id,smiles,name,desalted_smiles,status
1,CCO.[Na+],ethanol_sodium,CCO,success
2,c1ccccc1.[Cl-],benzene_hcl,c1ccccc1,success
Install Dependencies
pip install rdkit pandas
Processing Logic
- Parse SMILES: Use RDKit to parse input string
- Component Splitting: Identify multiple molecular components separated by
.
- Core Identification:
- Default selects component with the most atoms
- Optional: based on molecular weight, ring count, etc.
- Output Result: Return clean core SMILES
Error Handling
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.
Examples
Example 1: Simple Inorganic Salt
Input: CCO.[Na+]
Output: CCO
Example 2: HCl Salt
Input: CN1C=NC2=C1C(=O)N(C)C(=O)N2C.Cl
Output: CN1C=NC2=C1C(=O)N(C)C(=O)N2C
Example 3: Complex Organic Salt
Input: CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C.C(C(=O)O)C(CC(=O)O)(C(=O)O)O
Output: CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C (retains larger caffeine molecule)
Notes
- This tool assumes the core is the component with the most atoms
- For co-crystals or multi-component drugs, manual review may be needed
- Some hydrochloride salts may exist as
[Cl-] or Cl
- It is recommended to sample and verify results
Author
OpenClaw Skill Hub
Version
v1.0.0
Risk Assessment
| Risk Indicator |
Assessment |
Level |
| Code Execution |
Python/R scripts executed locally |
Medium |
| Network Access |
No external API calls |
Low |
| File System Access |
Read input files, write output files |
Medium |
| Instruction Tampering |
Standard prompt guidelines |
Low |
| Data Exposure |
Output files saved to workspace |
Low |
Security Checklist
Prerequisites
No additional Python packages required.
Evaluation Criteria
Success Metrics
Test Cases
- Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Output Requirements
Every final response should make these items explicit when they are relevant:
- Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Input Validation
This skill accepts requests that match the documented purpose of smiles-de-salter and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
smiles-de-salter only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Response Template
Use the following fixed structure for non-trivial requests:
- Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
Inputs to Collect
- Required inputs: the user goal, the primary data or source file, and the requested output format.
- Optional inputs: output directory, formatting preferences, and validation constraints.
- If a required input is unavailable, return a short clarification request before continuing.
Output Contract
- Return a short summary, the main deliverables, and any assumptions that materially affect interpretation.
- If execution is partial, label what succeeded, what failed, and the next safe recovery step.
- Keep the final answer within the documented scope of the skill.
Validation and Safety Rules
- Validate identifiers, file paths, and user-provided parameters before execution.
- Do not fabricate results, metrics, citations, or downstream conclusions.
- Use safe fallback behavior when dependencies, credentials, or required inputs are missing.
- Surface any execution failure with a concise diagnosis and recovery path.
1---2name: smiles-de-salter3description: Analyze data with `smiles-de-salter` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8# SMILES De-salter
9
10ID: 176
11
12Batch process chemical structure strings, removing salt ion portions and retaining only the active core.
13
14## When to Use
15
16- Use this skill when the task needs Batch process chemical SMILES strings to remove salt ions and retain.
17- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
18- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
19
20## Key Features
21
22- Scope-focused workflow aligned to: Analyze data with `smiles-de-salter` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.
23- Packaged executable path(s): `scripts/main.py`.
24- Reference material available in `references/` for task-specific guidance.
25- Structured execution path designed to keep outputs consistent and reviewable.
26
27## Dependencies
28
29- Python >= 3.8
30- rdkit >= 2022.03.1
31
32## Example Usage
33
34See `## Usage` above for related details.
35
36```bash
37cd "20260318/scientific-skills/Data Analytics/smiles-de-salter"
38python -m py_compile scripts/main.py
39python scripts/main.py --help
40```
41
42Example run plan:
431. Confirm the user input, output path, and any required config values.
442. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.
453. Run `python scripts/main.py` with the validated inputs.
464. Review the generated output and return the final artifact with any assumptions called out.
47
48## Implementation Details
49
50See `## Workflow` above for related details.
51
52- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
53- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
54- Primary implementation surface: `scripts/main.py`.
55- Reference guidance: `references/` contains supporting rules, prompts, or checklists.
56- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
57- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
58
59## Quick Check
60
61Use this command to verify that the packaged script entry point can be parsed before deeper execution.
62
63```bash
64python -m py_compile scripts/main.py
65```
66
67## Audit-Ready Commands
68
69Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
70
71```bash
72python -m py_compile scripts/main.py
73python scripts/main.py --help
74python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan."
75```
76
77## Workflow
78
791. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
802. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
813. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
824. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
835. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
84
85## Function Description
86
87This Skill is used to process chemical SMILES strings, automatically identifying and removing counterions, retaining only the active pharmaceutical ingredient (API).
88
89### Salt Ion Identification Rules
90
91- Identify multiple components through `.` separator
92- Salt ions are usually smaller ions (such as Na⁺, Cl⁻, K⁺, Br⁻, etc.)
93- Retain the component with the most atoms as the core
94- Support common inorganic salts and organic acid salts
95
96### Supported Salt Types
97
98| Type | Examples |
99|------|------|
100| Inorganic salts | NaCl, KCl, HCl, H₂SO₄ |
101| Organic acid salts | Citrate, Tartrate, Maleate |
102| Quaternary ammonium salts | Various quaternary ammonium compounds |
103
104## Usage
105
106### Command Line
107
108```text
109python -m py_compile scripts/main.py
110
111# Example invocation: python scripts/main.py -i input.csv -o output.csv -c smiles_column
112```
113
114### Parameter Description
115
116| Parameter | Short | Description | Default |
117|------|------|------|--------|
118| `--input` | `-i` | Input file path (CSV/TSV/SMILES) | Required |
119| `--output` | `-o` | Output file path | desalted_output.csv |
120| `--column` | `-c` | SMILES column name | smiles |
121| `--keep-largest` | `-k` | Keep largest component (by atom count) | True |
122
123### Single Processing Example
124
125```text
126python scripts/main.py -s "CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C.[Na+]"
127
128# Output: CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C
129```
130
131## Input Format
132
133### CSV/TSV Files
134
135```csv
136id,smiles,name
1371,CCO.[Na+],ethanol_sodium
1382,c1ccccc1.[Cl-],benzene_hcl
139```
140
141### Pure SMILES Files
142
143One SMILES string per line:
144```
145CCO.[Na+]
146c1ccccc1.[Cl-]
147```
148
149## Output Format
150
151Output file contains original data and new processing result columns:
152
153```csv
154id,smiles,name,desalted_smiles,status
1551,CCO.[Na+],ethanol_sodium,CCO,success
1562,c1ccccc1.[Cl-],benzene_hcl,c1ccccc1,success
157```
158
159## Install Dependencies
160
161```text
162pip install rdkit pandas
163```
164
165## Processing Logic
166
1671. **Parse SMILES**: Use RDKit to parse input string
1682. **Component Splitting**: Identify multiple molecular components separated by `.`
1693. **Core Identification**:
170 - Default selects component with the most atoms
171 - Optional: based on molecular weight, ring count, etc.
1724. **Output Result**: Return clean core SMILES
173
174## Error Handling
175
176- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
177- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
178- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
179- Do not fabricate files, citations, data, search results, or execution outcomes.
180
181## Examples
182
183### Example 1: Simple Inorganic Salt
184
185Input: `CCO.[Na+]`
186Output: `CCO`
187
188### Example 2: HCl Salt
189
190Input: `CN1C=NC2=C1C(=O)N(C)C(=O)N2C.Cl`
191Output: `CN1C=NC2=C1C(=O)N(C)C(=O)N2C`
192
193### Example 3: Complex Organic Salt
194
195Input: `CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C.C(C(=O)O)C(CC(=O)O)(C(=O)O)O`
196Output: `CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C` (retains larger caffeine molecule)
197
198## Notes
199
2001. This tool assumes the core is the component with the most atoms
2012. For co-crystals or multi-component drugs, manual review may be needed
2023. Some hydrochloride salts may exist as `[Cl-]` or `Cl`
2034. It is recommended to sample and verify results
204
205## Author
206
207OpenClaw Skill Hub
208
209## Version
210
211v1.0.0
212
213## Risk Assessment
214
215| Risk Indicator | Assessment | Level |
216|----------------|------------|-------|
217| Code Execution | Python/R scripts executed locally | Medium |
218| Network Access | No external API calls | Low |
219| File System Access | Read input files, write output files | Medium |
220| Instruction Tampering | Standard prompt guidelines | Low |
221| Data Exposure | Output files saved to workspace | Low |
222
223## Security Checklist
224
225- [ ] No hardcoded credentials or API keys
226- [ ] No unauthorized file system access (../)
227- [ ] Output does not expose sensitive information
228- [ ] Prompt injection protections in place
229- [ ] Input file paths validated (no ../ traversal)
230- [ ] Output directory restricted to workspace
231- [ ] Script execution in sandboxed environment
232- [ ] Error messages sanitized (no stack traces exposed)
233- [ ] Dependencies audited
234
235## Prerequisites
236
237No additional Python packages required.
238
239## Evaluation Criteria
240
241### Success Metrics
242- [ ] Successfully executes main functionality
243- [ ] Output meets quality standards
244- [ ] Handles edge cases gracefully
245- [ ] Performance is acceptable
246
247### Test Cases
2481. **Basic Functionality**: Standard input → Expected output
2492. **Edge Case**: Invalid input → Graceful error handling
2503. **Performance**: Large dataset → Acceptable processing time
251
252## Lifecycle Status
253
254- **Current Stage**: Draft
255- **Next Review Date**: 2026-03-06
256- **Known Issues**: None
257- **Planned Improvements**:
258 - Performance optimization
259 - Additional feature support
260
261## Output Requirements
262
263Every final response should make these items explicit when they are relevant:
264
265- Objective or requested deliverable
266- Inputs used and assumptions introduced
267- Workflow or decision path
268- Core result, recommendation, or artifact
269- Constraints, risks, caveats, or validation needs
270- Unresolved items and next-step checks
271
272## Input Validation
273
274This skill accepts requests that match the documented purpose of `smiles-de-salter` and include enough context to complete the workflow safely.
275
276Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
277
278> `smiles-de-salter` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
279
280## Response Template
281
282Use the following fixed structure for non-trivial requests:
283
2841. Objective
2852. Inputs Received
2863. Assumptions
2874. Workflow
2885. Deliverable
2896. Risks and Limits
2907. Next Checks
291
292If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
293
294## Inputs to Collect
295
296- Required inputs: the user goal, the primary data or source file, and the requested output format.
297- Optional inputs: output directory, formatting preferences, and validation constraints.
298- If a required input is unavailable, return a short clarification request before continuing.
299
300## Output Contract
301
302- Return a short summary, the main deliverables, and any assumptions that materially affect interpretation.
303- If execution is partial, label what succeeded, what failed, and the next safe recovery step.
304- Keep the final answer within the documented scope of the skill.
305
306## Validation and Safety Rules
307
308- Validate identifiers, file paths, and user-provided parameters before execution.
309- Do not fabricate results, metrics, citations, or downstream conclusions.
310- Use safe fallback behavior when dependencies, credentials, or required inputs are missing.
311- Surface any execution failure with a concise diagnosis and recovery path.