On 23 August 2010 20:34, Chris Morley <c.mor...@gaseq.co.uk> wrote:
> On 23/08/2010 18:48, Noel O'Boyle wrote:
>> Here's the doxygen docs. I'll check it in once I've checked the HTML.
>> Note that I've changed the method to return a bool (this method will
>> be new in 2.3).
>>
>>    /**
>>     * Convert a molecule's Tetrahedral Stereo objects to a series of hash or
>>     * wedge bonds. Note that the molecule itself is not modified; the result
>>     * is returned in the maps @param updown and @param from, which indicate
>>     * the origin and direction of each hash or wedge bond.
>>     *
>>     * When converting, the following guidelines are followed when trying to
>>     * find the best candidate bond to set up/down for each tetrahedral stereo
>>     * object:
>>     * 1. **Should not already be set**
>>     * 2. Should not be connected to a 2nd tet center
>>     *    (this is acceptable in theory, as the wedge is only at one end but
>>     *     it may cause confusion and thus we avoid it)
>>     * 3. Preferably is not in a cycle
>>     * 4. Preferably is a terminal H
>>     *
>>     * If no bond can be found that matches all of these rules (and there is
>>     * a slim possibility of this at the moment) then an error message is 
>> logged
>>     * and the function returns false.
>>     *
>>     * @param mol The molecule.
>>     * @param updown A map of OBStereo::BondDirection for each hash/wedge bond
>>     * @param from A map of OBStereo::Ref indicate the origin of each
>> hash/wedge bond
>>     *
>>     * @since version 2.3
>>     */
>>    OBAPI bool TetStereoTo0D(OBMol&mol,
>>        std::map<OBBond*, enum OBStereo::BondDirection>  &updown,
>>        std::map<OBBond*, OBStereo::Ref>  &from);
>>
>> This function is called from inchiformat and mdlformat.
>
> Thanks for the prompt response.
>
> The function's name doesn't seem right. Aren't wedge and hash 2D
> concepts, not 0D, even if coordinates do not appear in the function?
> It's from 0D to 2D?

Actually, to complicate it further, wedge and hash are 3D concepts.
How about TetStereoToWedgeHash? It should be pointed out however that
this code doesn't affect wedge/hash bond properties - it just returns
information. Feel free to change the name if you think this is better.

> I'll try to get round to calling this in OpGen2D::Do() and modifying
> the molecule. As Tim says there does seem to be some related code in
> the MCDL, but it is not likely to be as shiny and gold-plated as OB's
> new stereo code.
>
>
>> On 23 August 2010 18:11, Noel O'Boyle<baoille...@gmail.com>  wrote:
>>> On 23 August 2010 15:43, Chris Morley<c.mor...@gaseq.co.uk>  wrote:
>>>> I'm trying to get wedge and hash bonds displayed in SVGFormat,
>>>> starting with a 0D molecule. (Note the new SMILES input.)
>>>>
>>>> This doesn't:
>>>> obabel -:b...@h](F)I  --gen2D -O out.svg
>>>>
>>>> This does:
>>>> obabel -:b...@h](F)I -omol --gen2D -xw | obabel -imol -O out.svg
>>>>
>>>> This doesn't:
>>>> obabel -:b...@h](F)I -omol --gen2D     | obabel -imol -O out.svg
>>>>
>>>> So presumably calling TetStereoTo0D() does the job and it really
>>>> should be called in --gen2D. There is a lack of documentation "(HASSLE
>>>> NOEL ABOUT THIS!!)" and I don't understand where the parameter
>>>> std::map<OBBond*, OBStereo::Ref>  &from should come from.
>>>>
>>>> Can anybody help?
>>>
>>> Consider me hassled. I'll write these docs in the next few minutes
>>> once I figure it out.
>>>
>>>> I also guess we could talk about why it is necessary for
>>>>
>>>> obabel -:b...@h](F)I -omol | obabel -imol -osmi
>>>>
>>>> to drop the stereo information.
>>>
>>> Discussed at 
>>> http://baoilleach.blogspot.com/2010/02/how-to-store-stereochemistry-in-mol.html.
>>> I don't think it's neccessary to drop the stereo but the spec says to
>>> do it. I added the "s" option to MDL to enable the atom stereo parity
>>> to be optionally retained. Hopefully this works for you.
>
> Sorry not to keep up with the literature and to miss the -as option.
> This should mean that
> obabel -:b...@h](F)I -omol | obabel -imol -osmi -as
> should give a chiral SMILES output?
>
> It doesn't, and I can't even find any code for the implementation of
> the option. I hope some purist hasn't edited it out ;-)

Aha, I think this was maybe some unfinished business for me - the last
thing I did on the stereo before I burnt out. I think the code is in
there to do it - I just need to add an "if" statement. I'll try to
sort this out.

> Chris
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> OpenBabel-Devel mailing list
> OpenBabel-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to