{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-data-analysis-smiles-de-salter-3b7115291f84","title":"Process Chemical SMILES Strings to Remove Salt Ions","summary":"Batch process chemical SMILES strings to remove salt ion portions and retain only the active core. Requires Python 3.8+ and RDKit 2022.03.1.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-smiles-de-salter-3b7115291f84","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-smiles-de-salter-3b7115291f84","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-smiles-de-salter-3b7115291f84.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-smiles-de-salter-3b7115291f84\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Ensure Python 3.8 or higher and RDKit 2022.03.1 are installed before running the script. Confirm the input file path, output directory, and any required configuration values before execution.","instructions":"---\nname: smiles-de-salter\ndescription: Analyze data with `smiles-de-salter` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# SMILES De-salter\n\nID: 176\n\nBatch process chemical structure strings, removing salt ion portions and retaining only the active core.\n\n## When to Use\n\n- Use this skill when the task needs Batch process chemical SMILES strings to remove salt ions and retain.\n- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.\n- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.\n\n## Key Features\n\n- Scope-focused workflow aligned to: Analyze data with `smiles-de-salter` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.\n- Packaged executable path(s): `scripts\/main.py`.\n- Reference material available in `references\/` for task-specific guidance.\n- Structured execution path designed to keep outputs consistent and reviewable.\n\n## Dependencies\n\n- Python >= 3.8\n- rdkit >= 2022.03.1\n\n## Example Usage\n\nSee `## Usage` above for related details.\n\n```bash\ncd \"20260318\/scientific-skills\/Data Analytics\/smiles-de-salter\"\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\n```\n\nExample run plan:\n1. Confirm the user input, output path, and any required config values.\n2. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.\n3. Run `python scripts\/main.py` with the validated inputs.\n4. Review the generated output and return the final artifact with any assumptions called out.\n\n## Implementation Details\n\nSee `## Workflow` above for related details.\n\n- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.\n- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.\n- Primary implementation surface: `scripts\/main.py`.\n- Reference guidance: `references\/` contains supporting rules, prompts, or checklists.\n- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.\n- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.\n\n## Quick Check\n\nUse this command to verify that the packaged script entry point can be parsed before deeper execution.\n\n```bash\npython -m py_compile scripts\/main.py\n```\n\n## Audit-Ready Commands\n\nUse these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.\n\n```bash\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\npython scripts\/main.py --input \"Audit validation sample with explicit symptoms, history, assessment, and next-step plan.\"\n```\n\n## Workflow\n\n1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.\n2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.\n3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.\n4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.\n5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.\n\n## Function Description\n\nThis Skill is used to process chemical SMILES strings, automatically identifying and removing counterions, retaining only the active pharmaceutical ingredient (API).\n\n### Salt Ion Identification Rules\n\n- Identify multiple components through `.` separator\n- Salt ions are usually smaller ions (such as Na\u207a, Cl\u207b, K\u207a, Br\u207b, etc.)\n- Retain the component with the most atoms as the core\n- Support common inorganic salts and organic acid salts\n\n### Supported Salt Types\n\n| Type | Examples |\n|------|------|\n| Inorganic salts | NaCl, KCl, HCl, H\u2082SO\u2084 |\n| Organic acid salts | Citrate, Tartrate, Maleate |\n| Quaternary ammonium salts | Various quaternary ammonium compounds |\n\n## Usage\n\n### Command Line\n\n```text\npython -m py_compile scripts\/main.py\n\n# Example invocation: python scripts\/main.py -i input.csv -o output.csv -c smiles_column\n```\n\n### Parameter Description\n\n| Parameter | Short | Description | Default |\n|------|------|------|--------|\n| `--input` | `-i` | Input file path (CSV\/TSV\/SMILES) | Required |\n| `--output` | `-o` | Output file path | desalted_output.csv |\n| `--column` | `-c` | SMILES column name | smiles |\n| `--keep-largest` | `-k` | Keep largest component (by atom count) | True |\n\n### Single Processing Example\n\n```text\npython scripts\/main.py -s \"CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C.[Na+]\"\n\n# Output: CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C\n```\n\n## Input Format\n\n### CSV\/TSV Files\n\n```csv\nid,smiles,name\n1,CCO.[Na+],ethanol_sodium\n2,c1ccccc1.[Cl-],benzene_hcl\n```\n\n### Pure SMILES Files\n\nOne SMILES string per line:\n```\nCCO.[Na+]\nc1ccccc1.[Cl-]\n```\n\n## Output Format\n\nOutput file contains original data and new processing result columns:\n\n```csv\nid,smiles,name,desalted_smiles,status\n1,CCO.[Na+],ethanol_sodium,CCO,success\n2,c1ccccc1.[Cl-],benzene_hcl,c1ccccc1,success\n```\n\n## Install Dependencies\n\n```text\npip install rdkit pandas\n```\n\n## Processing Logic\n\n1. **Parse SMILES**: Use RDKit to parse input string\n2. **Component Splitting**: Identify multiple molecular components separated by `.`\n3. **Core Identification**:\n   - Default selects component with the most atoms\n   - Optional: based on molecular weight, ring count, etc.\n4. **Output Result**: Return clean core SMILES\n\n## Error Handling\n\n- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.\n- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.\n- If `scripts\/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.\n- Do not fabricate files, citations, data, search results, or execution outcomes.\n\n## Examples\n\n### Example 1: Simple Inorganic Salt\n\nInput: `CCO.[Na+]`\nOutput: `CCO`\n\n### Example 2: HCl Salt\n\nInput: `CN1C=NC2=C1C(=O)N(C)C(=O)N2C.Cl`\nOutput: `CN1C=NC2=C1C(=O)N(C)C(=O)N2C`\n\n### Example 3: Complex Organic Salt\n\nInput: `CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C.C(C(=O)O)C(CC(=O)O)(C(=O)O)O`\nOutput: `CC(C)CN1C(=O)N(C)C(=O)C2=C1N=CN2C` (retains larger caffeine molecule)\n\n## Notes\n\n1. This tool assumes the core is the component with the most atoms\n2. For co-crystals or multi-component drugs, manual review may be needed\n3. Some hydrochloride salts may exist as `[Cl-]` or `Cl`\n4. It is recommended to sample and verify results\n\n## Author\n\nOpenClaw Skill Hub\n\n## Version\n\nv1.0.0\n\n## Risk Assessment\n\n| Risk Indicator | Assessment | Level |\n|----------------|------------|-------|\n| Code Execution | Python\/R scripts executed locally | Medium |\n| Network Access | No external API calls | Low |\n| File System Access | Read input files, write output files | Medium |\n| Instruction Tampering | Standard prompt guidelines | Low |\n| Data Exposure | Output files saved to workspace | Low |\n\n## Security Checklist\n\n- [ ] No hardcoded credentials or API keys\n- [ ] No unauthorized file system access (..\/)\n- [ ] Output does not expose sensitive information\n- [ ] Prompt injection protections in place\n- [ ] Input file paths validated (no ..\/ traversal)\n- [ ] Output directory restricted to workspace\n- [ ] Script execution in sandboxed environment\n- [ ] Error messages sanitized (no stack traces exposed)\n- [ ] Dependencies audited\n\n## Prerequisites\n\nNo additional Python packages required.\n\n## Evaluation Criteria\n\n### Success Metrics\n- [ ] Successfully executes main functionality\n- [ ] Output meets quality standards\n- [ ] Handles edge cases gracefully\n- [ ] Performance is acceptable\n\n### Test Cases\n1. **Basic Functionality**: Standard input \u2192 Expected output\n2. **Edge Case**: Invalid input \u2192 Graceful error handling\n3. **Performance**: Large dataset \u2192 Acceptable processing time\n\n## Lifecycle Status\n\n- **Current Stage**: Draft\n- **Next Review Date**: 2026-03-06\n- **Known Issues**: None\n- **Planned Improvements**: \n  - Performance optimization\n  - Additional feature support\n\n## Output Requirements\n\nEvery final response should make these items explicit when they are relevant:\n\n- Objective or requested deliverable\n- Inputs used and assumptions introduced\n- Workflow or decision path\n- Core result, recommendation, or artifact\n- Constraints, risks, caveats, or validation needs\n- Unresolved items and next-step checks\n\n## Input Validation\n\nThis skill accepts requests that match the documented purpose of `smiles-de-salter` and include enough context to complete the workflow safely.\n\nDo not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\n\n> `smiles-de-salter` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\n\n## Response Template\n\nUse the following fixed structure for non-trivial requests:\n\n1. Objective\n2. Inputs Received\n3. Assumptions\n4. Workflow\n5. Deliverable\n6. Risks and Limits\n7. Next Checks\n\nIf the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.\n\n## Inputs to Collect\n\n- Required inputs: the user goal, the primary data or source file, and the requested output format.\n- Optional inputs: output directory, formatting preferences, and validation constraints.\n- If a required input is unavailable, return a short clarification request before continuing.\n\n## Output Contract\n\n- Return a short summary, the main deliverables, and any assumptions that materially affect interpretation.\n- If execution is partial, label what succeeded, what failed, and the next safe recovery step.\n- Keep the final answer within the documented scope of the skill.\n\n## Validation and Safety Rules\n\n- Validate identifiers, file paths, and user-provided parameters before execution.\n- Do not fabricate results, metrics, citations, or downstream conclusions.\n- Use safe fallback behavior when dependencies, credentials, or required inputs are missing.\n- Surface any execution failure with a concise diagnosis and recovery path.\n","use_cases":["Desalt chemical SMILES strings for drug discovery analysis","Clean up chemical data for pharmacological research","Prepare chemical structures for molecular modeling"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Data%20Analysis\/smiles-de-salter\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T12:52:33.000000Z","updated_at":"2026-11-24T12:17:13.000000Z","seo_title":"Process SMILES strings to remove salt ions","seo_description":"Batch process chemical SMILES strings to remove salt ions and retain the active core. Supports inorganic and organic acid salts. Requires Python 3.8+ and RDKit 2022.03.1.","seo_keywords":["SMILES desalting","chemical structure processing","drug discovery data cleaning","salt ion removal","pharmaceutical data analysis"]}}