Function Repository Resource:

MoleculeNeutralize

Source Notebook

Neutralize the ionic form of a molecule provided as a Molecule, SMILES or InChI string

Contributed by: Joshua Schrier

ResourceFunction["MoleculeNeutralize"][m]

neutralizes the charges on a molecule m specified as a Molecule, SMILES string or InChI string.

ResourceFunction["MoleculeNeutralize"][m,format]

changes the output format to differ from the input format.

ResourceFunction["MoleculeNeutralize"][m,format,options]

specifies additional or substitute rules for the neutralization reactions as options.

Details and Options

ResourceFunction["MoleculeNeutralize"] internally converts SMILES and InChI strings to Molecule expressions before computing neutralizations.
The function uses explicit SMARTS-based transformation rules for neutralizing imidazoles, amines, thiols, sulfonamides, enamines, tetrazoles, sulfoxides, amides, carboxylic acids and alcohols. Charges from other chemical groups are left unmodified.
The default returns the neutralized molecule in the same representation as it was input. Setting the format argument forces the output to be returned in a different form; choices include "SMILES", "Molecule", "InChI" and "InChIKey".
Two options can be used to provide lists of SMARTS replacement rules to be used instead of the default rules ("UseRules") or in addition to the default rules ("AddRules").
ResourceFunction["MoleculeNeutralize"] is Listable.

Examples

Basic Examples (4) 

Inputs provided as Molecule are returned as Molecule:

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/acfda4ed-c427-4d7b-bf9a-a08a49dc5808"]

Inputs provided as a SMILES strings are returned as SMILES strings:

In[2]:=
ResourceFunction["MoleculeNeutralize"]["c1cccc[nH+]1"]
Out[2]=

Inputs provides as InChI strings are returned as InChI strings:

In[3]:=
ResourceFunction[
 "MoleculeNeutralize"]["InChI=1S/C5H5N/c1-2-4-6-5-3-1/h1-5H/p+1"]
Out[4]=

Lists of inputs can be provided, and each element is processed according to its appropriate type:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/edf8910d-a553-4214-9aac-73b22913799d"]
Out[5]=

Scope (3) 

All possible neutralizations are performed if a molecule contains multiple charged sites:

In[6]:=
ResourceFunction["MoleculeNeutralize"]["[NH3+]CC[NH3+]"]
Out[6]=

Only neutralization reactions that can be achieved by adding or removing protons without breaking other bonds are performed; as a result, the final molecule may not have charge 0. For example, a quaternary ammonium must have a positive charge to satisfy valence rules:

In[7]:=
ResourceFunction["MoleculeNeutralize"]["C[N+](C)(C)C"]
Out[7]=

By default, MoleculeNeutralize returns the molecule in the same representation it was provided. Setting the second argument overrides this; choices include "InChI", "InChIKey", "Molecule" and "SMILES":

In[8]:=
ResourceFunction["MoleculeNeutralize"]["[NH3+]CC[NH3+]", "InChI"]
Out[8]=
In[9]:=
ResourceFunction["MoleculeNeutralize"]["[NH3+]CC[NH3+]", "InChIKey"]
Out[9]=
In[10]:=
ResourceFunction["MoleculeNeutralize"]["[NH3+]CC[NH3+]", "Molecule"]
Out[10]=
In[11]:=
ResourceFunction["MoleculeNeutralize"]["[NH3+]CC[NH3+]", "Molecule"]
Out[11]=

Options (2) 

UseRules (1) 

The "UseRules" option allows you to specify a list of reaction rules that will be used instead of the default charge neutralization rules:

In[12]:=
ResourceFunction["MoleculeNeutralize"]["c1cccc[nH+]1", "UseRules" -> {"[n+;H]" -> "c"}]
Out[12]=

AddRules (1) 

The "AddRules" option allows you to specify a list of reaction rules that will be applied after the default charge neutralization rules have been applied:

In[13]:=
ResourceFunction["MoleculeNeutralize"]["CC[NH3+]", "AddRules" -> {"CC" -> "CCC"}]
Out[13]=

Publisher

Joshua Schrier

Version History

  • 1.0.0 – 04 March 2020

Source Metadata

Related Resources

License Information