openmolecules.org

 
Home » DataWarrior » Functionality » Find & Replace or alternative for stereoisomers
Find & Replace or alternative for stereoisomers [message #1714] Mon, 29 August 2022 19:55 Go to next message
Paul is currently offline  Paul
Messages: 16
Registered: May 2019
Location: United States
Junior Member
Hello All

I would like to invert the configuration of all asymmetric carbon atoms (sp3) in a data set.

I have made many attempts using Find & Replace, but only succeed when exact carbon skeletons are supplied.

For example, I can convert 3,3,4(S)-trimethylhexane to 3,3,4(R)-trimethylhexane, but I cannot convert all structures with that common sub-structure to the inverted configuration for higher alkanes.

It seemed to me that the Query Feature Dialog would be appropriate for this use. The dialog is accessible (using the "q" key on hovering on an atom/bond) in the Find This structure editor window. However, the query feature only produces the "unknown" response in the replace with structure editor window.

Ultimately, I would like to generate a specific molecular representation for every stereoisomer, for each substance with 1 or more asymmetric carbon atoms in a data set.

So far, I have accomplished this by using smiles with @/@@ notation in Excel spreadsheets (this approach is somewhat doable in DataWarrior for simple cases, but much easier in Excel with more than 1 asymmetric C-atom. The method quickly goes from clunky to prohibitive as molecular complexity/number of asymmetric C-atoms increases.

Is this something for DataWarrior is suited?

I've attached a DWAR for C9H20 compounds with no racemates, should anyone want to use it for an example.

Thanks,

Paul
Re: Find & Replace or alternative for stereoisomers [message #1718 is a reply to message #1714] Tue, 30 August 2022 21:29 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Hi Paul,

this is an unusual request, which you cannot do in DataWarrior directly. However, based on your idea to do text replacements in SMILES, you could run the following macro (copy the macro text below and select 'Macro->Paste Macro' in you open DataWarrior window. The run the macro with 'Macro->Run Macro->Invert Stereo Centers):

<macro name="Invert Stereo Centers">
<task name="addSmilesCodes">
structureColumn=Structure
</task>
<task name="findAndReplace">
isStructure=false
column=Smiles
what=@@
with=##
</task>
<task name="findAndReplace">
isStructure=false
column=Smiles
what=@
with=@@
</task>
<task name="findAndReplace">
isStructure=false
column=Smiles
what=##
with=@
</task>
<task name="addStructuresFromName">
useServer=false
column=Smiles
isSmarts=false
</task>
</macro>
Re: Find & Replace or alternative for stereoisomers [message #1721 is a reply to message #1718] Wed, 31 August 2022 18:36 Go to previous message
Paul is currently offline  Paul
Messages: 16
Registered: May 2019
Location: United States
Junior Member
Thanks!

That works, and gave me an example to work from to add to my macro library.

Best Regards,

Paul
Previous Topic: Assign cluster name based on cluster size
Next Topic: Macro for evolutionary library (EL) in Datwarrior (DW)
Goto Forum:
  


Current Time: Fri Nov 22 05:43:38 CET 2024

Total time taken to generate the page: 0.04087 seconds