5
$\begingroup$

I have a SMILES string as follows.

smi= 'CCOC(=O)C1=C(COCCN)NC(C)=C(C(=O)OC)C1c1ccccc1Cl'

Is there anyway that I convert this SMILES string into valid sub-strings which can be later processed in RDKIT.

For instance

smi_sub1= 'C1c1ccccc1Cl'
smi_sub2= 'CCOC(=O)C1=C(COCCN)NC(C)=C(C(=O)OC)'
smi_sub3= 'C1=C(COCCN)NC(C)=C(C(=O)OC)'

These sub-strings should be subset of the main SMILES string and should also be valid from the SMILES syntax point of view.

So that when I use the function MolFromSmiles, It get processed without any error or none in return?

Mol_sub1 = Chem.MolFromSmiles(smi_sub1)
Mol_sub2 = Chem.MolFromSmiles(smi_sub2)
Mol_sub3 = Chem.MolFromSmiles(smi_sub3)
$\endgroup$
1
5
$\begingroup$

While this might work in some cases, I am not sure how well it will work in general. The problem here might be reflected in this statement:

These sub-strings should be subset of the main SMILES string

Not every substring will be a subgraph of the parent molecule. As mentioned in the comments, this seems essentially a fragmentation problem. Take this one of your examples:

smi_sub1= 'C1c1ccccc1Cl'

The reason this won't parse is that it starts with a 'C1' but has no corresponding 'C1' to finish the ring. So it should be 'Cc1ccccc1Cl', which is 1-chloro-2-methylbenzene.

Theoretically, you could take substrings, then post-process them to remove 'disconnected' ring numbers. However, it would make more sense to use proper fragmentation on the molecular graph, and then you would have correct subgraphs anyway, without the need to convert them from SMILES.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.