Turn every structure in a workspace into its parent molecule: counter-ions and solvents removed, charges neutralised. The results go to a new workspace; the table you start from is not changed.
Each structure is split into its fragments (the parts separated by dots in SMILES). Then three steps run in order, the same rules as iBabel's Strip salts and solvents tool, which follows the ChEMBL Structure Pipeline:
A fragment is removed only when it is the same whole structure as a list entry, never when it merely contains one. Ethyl acetate is not acetate, and a drug with a benzoic acid in it is not benzoate.
Fragments and list entries are compared by the main layer of their standard InChI (formula, connections and H positions). That layer ignores charge, protonation and stereo, so:
The tautomer point means one entry covers both forms of a counter-ion that can move an H between N and O. Orotic acid is listed in its hydroxy form, and the usual oxo form still matches it.
The InChI comes from Vortex's own calculator, and is worked out only for fragments whose heavy atoms could match a list entry, so large workspaces stay quick.
Open the workspace you want to clean and choose Scripts › My_Scripts › StripSaltsSolvents.
salt_test.csv.| Option | Default |
|---|---|
| Table Shown only when the workspace has more than one table. | current |
| Strip salts and counter-ions Step 1. | on |
| Strip solvents Step 2. | on |
| Neutralise the parent Step 3. Turn off to keep charges as drawn. | on |
| Include an Input SMILES column Adds the original structure next to the parent. | on |
| New workspace name Taken from the source workspace. | … parents |
Click OK to start. A progress bar shows each block of 20,000 rows, and you can cancel; nothing is created if you do.
When the progress bar closes, a new workspace opens with one row per source row, in the same order. Its columns are:
| Column | Contents |
|---|---|
| SMILES | The parent structure. Vortex draws it as the structure column. |
| Input SMILES | The structure as it was, if you ticked that option. |
| Removed | What was taken off, by list name, for example Water; Chloride or Potassium ×2; Benzoate. |
| Parent status | What happened to the row (see below). |
| others | Every other column of the source table. A column already called SMILES comes across as Original SMILES. |
| stripped | Salts or solvents were removed. |
| neutralised | Charges were removed. Can appear with stripped. |
| unchanged | Nothing to do. |
| all salts, kept | Every fragment is a salt, so the record was left whole. |
| all solvents, kept | Every fragment left is a solvent, so it was left whole. |
| explicit H, not neutralised | The structure has explicit H atoms, which the neutraliser does not handle. |
| not processed | The row has no structure, or Vortex could not read it. The row is still copied. |
A message then gives the counts for each status, the ten fragments removed most often, and how long the run took.
Not neutralised, net charge counts records the neutraliser left alone because it would have charged a neutral molecule. In the test that is betaine, which stays a zwitterion.
If any list entry could not be read by Vortex, it is named at the end of the message. That entry then never matches, so fix its SMILES.
The lists are part of the script, near the top, as SALTS and SOLVENTS: 166 salts and counter-ions, and 9 solvents. One entry per line, a name, a tab, then the SMILES. Lines starting with # are ignored. Edit them there; the name you give is what appears in the Removed column.
SALTS = r""" Tetrafluoroboranuide F[B-](F)(F)F Arginine NC(CCCNC(=N)N)C(=O)O ... """
They are ChEMBL's lists, the same ones iBabel uses, with one change: Orotic acid is written OC(c1nc(O)nc(O)c1)=O, because ChEMBL's version could not be read by Vortex.
Water and triethylamine are on the salt list. ChEMBL lists water as both a salt and a solvent, and a few amines, such as triethylamine, as counter-ions. So a hydrochloride hydrate loses both the chloride and the water in step 1.
Copy the script into your Vortex scripts folder. It appears in the Scripts menu straight away; no restart is needed.
~/vortex/scripts/My_Scripts/StripSaltsSolvents.vpy
Written for Vortex 26.05 (Jython 2.5). It uses only Vortex's built-in calculator, so no external tools or Python environments are needed.
This folder also holds salt_test.csv, the 14-row table used for the pictures, and test_strip.py, which checks the matching and neutralising logic outside Vortex with RDKit in place of the Vortex calculator:
python test_strip.py ~/vortex/scripts/My_Scripts/StripSaltsSolvents.vpy