Tim,
Thanks - this is what I need! I am going to save wavy bonds in sd file for
structures recognized by osra. Having setWavy() wrapper would be great too.
By the way I am at the ACS meeting, are you here as well?
Igor
On Aug 20, 2012 10:23 AM, "Tim Vandermeersch" <tim.vandermeer...@gmail.com>
wrote:
> On Mon, Aug 20, 2012 at 4:12 PM, Tim Vandermeersch
> <tim.vandermeer...@gmail.com> wrote:
> > On Mon, Aug 20, 2012 at 4:08 PM, Tim Vandermeersch
> > <tim.vandermeer...@gmail.com> wrote:
> >> 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.
> >
> > Hmm, I just though of the use case where you need to write a wavy bond
> > to a file format.I don't know what file formats support wavy bond
> > output but if they do the same applies.
>
> Perhaps it's better to wait a few minutes before sending a mail but... :)
>
> We could add SetSpecified(unsigned long atomId), IsSpecified(unsigned
> int atomId), SetUnknown(...), IsUnknown(...) functions to stereo.h to
> make it easier for users. Additionally we could add SetWavy(...) and
> IsWavy(...) wrapper functions around [Set,Is]Unknown(...) for library
> users that want to interpret wavy bonds differently. In any case,
> OpenBabel selects which bond should be wavy and there is no way of
> explicitly specifying the wavy bonds but this can be seen as positive
> since this would be error-prone. Think of this as a feature :) If we
> add these functions, we should probably also check if the atom is
> stereogenic or not and allow for an override as in SetWavy(unsigned
> long atomId, bool force = false). Any ideas?
>
> Tim
>
> > Tim
> >
> >> 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