On Mon, Aug 20, 2012 at 3:18 PM, Igor Filippov
<igor.v.filip...@gmail.com> wrote:
> Noel,
>
> Thank you - could you give just a few lines example how to do this?
> I looked at the suggested header file and I'm still stumped :(

The code to set an atom's tetrahedral stereochemistry to unknown goes
something like this:

#include <openbabel/stereo/tetrahedral.h>

void SetTetrahedtalUnknown(OBAtom *atom)
{
  OBStereoFacade facade(atom->GetParent());
  OBTetrahedralStereo *stereo;
  if (facade.HasTetrahedralStereo(atom->GetId())
    stereo = facade.GetTetrahedralStereo(atom->GetId());
  else
    stereo = new OBTetrahedralStereo(atom->GetParent());

  OBTetrahedralStereo::Config config = stereo->GetConfig();
  config.center = atom->GetId();
  config.specified = true;
  config.winding = OBStereo::UnknownWinding;
  stereo->SetConfig(config);

  if (!facade.HasTetrahedralStereo(atom->GetId())
    atom->GetParent()->SetData(stereo);
}

To set the stereochemistry unspecified, change true to false in the
code above and remove the winding line. However, for many purposes
this would be the same as not having an OBTetrahedralStereo object for
that atom. Where needed, OpenBabel has algorithms to find which atoms
are stereogenic and does not rely on the user specifying which atoms
are stereogenic.

Could you tell me a bit more on why you would need wavy bonds? The
only application I can think of is for 2D depiction. OpenBabel's 2D
depiction only draws wavy bonds when the stereochemistry is specified
as unknown (could be RS, R or S). Another use of wavy bonds could be
to inform the reader that the atom is stereogenic and is a RS mixture
(or unknown) but this is not used by OpenBabel. This could easily be
achieved by calling SetTetrahedralUnknown() though and interpret the
depiction differently.

There is the TetStereoToWedgeHash() function in
src/stereo/perception.cpp that selects the optimal bond to be the
wavy.

Tim

>
> Igor
>
> On Sun, 2012-08-19 at 05:48 -0400, Noel O'Boyle wrote:
>> You can set the corresponding stereo config to defined=false.
>> Internally stereo is not stored as an attribute of a bond.
>>
>> - Noel
>>
>> On 17 August 2012 19:12, Igor Filippov [Contr] <filipp...@mail.nih.gov> 
>> wrote:
>> > Dear colleagues,
>> >
>> > Is it possible to set a bond as "wavy" or to check if it has "wavy"
>> > attribute in OB similar to SetWedge() and IsWedge()?
>> >
>> >
>> > Best regards,
>> > Igor
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Live Security Virtual Conference
>> > Exclusive live event will cover all the ways today's security and
>> > threat landscape has changed and how IT managers can respond. Discussions
>> > will include endpoint security, mobile security and the latest in malware
>> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> > _______________________________________________
>> > OpenBabel-discuss mailing list
>> > OpenBabel-discuss@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> OpenBabel-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to