wavy bond documentation

User 870ab5b546

16-06-2006 18:49:14

Hi,





In the JChem API, under Class MolBond, I see fields for UP and DOWN single bonds, but not for wavy bonds. Is there such a field?





Also, if I operate getAtom1 on a directional bond such as UP or DOWN, will it always return the atom to which the narrow end of the bond is pointing?





-- Bob

User f359e526a1

18-06-2006 08:01:47

Quote:
In the JChem API, under Class MolBond, I see fields for UP and DOWN single bonds, but not for wavy bonds. Is there such a field?


As far as I know, there is no extra field for this.
Quote:
Also, if I operate getAtom1 on a directional bond such as UP or DOWN, will it always return the atom to which the narrow end of the bond is pointing?


No, do not rely on that.

User 870ab5b546

18-06-2006 13:09:56

Quote:
Quote:
Also, if I operate getAtom1 on a directional bond such as UP or DOWN, will it always return the atom to which the narrow end of the bond is pointing?


No, do not rely on that.
Are you sure? Because I created two examples of 2-butanol with a wavy C-O bond, one in which the narrow end was at C4, the other in which the narrow end was at O5, and the only difference in the source was that in the first, the wavy bond was written in the source as:





Code:
        <bond atomRefs2="a4 a5" order="1">


          <bondStereo convention="MDL" conventionValue="4" />








and in the second, it was:





Code:
        <bond atomRefs2="a5 a4" order="1">


          <bondStereo convention="MDL" conventionValue="4" />








So if the order of atoms in the bond is the only difference in the files, it seems to me that the getAtom1() method should always return the atom to which the narrow end of the wedge is pointing. And if it doesn't, you need to change it so that it does.

User 870ab5b546

18-06-2006 14:35:51

szilva wrote:
Quote:
In the JChem API, under Class MolBond, I see fields for UP and DOWN single bonds, but not for wavy bonds. Is there such a field?


As far as I know, there is no extra field for this.


There should be.

ChemAxon 25dcd765a3

19-06-2006 12:24:27

The wavy bond is UP|DOWN, which is the same as the STEREO1_MASK.


You can easily set a bond to wavy:


Code:
      


MolBond b = m.getBond(i);


b.setFlags(STEREO1_MASK,STEREO1_MASK);








By default getNode1() will it always return the atom to which the narrow end of the bond is pointing.





All the best


Andras

User 870ab5b546

19-06-2006 13:02:19

volfi wrote:
The wavy bond is UP|DOWN, which is the same as the STEREO1_MASK.
UP|DOWN is not listed in your documentation. It should be.
volfi wrote:
By default getNode1() will it always return the atom to which the narrow end of the bond is pointing.
May I suggest that getAtom1 should do the same. It's awkward to have to create a CEdge just to get node1, when I have already created a MolBond, and getAtom1 should do the same.





In fact, may I suggest that in place of getNode1, getNode2, getAtom1, and getAtom2, you should have new methods getNode(int n) and getAtom(int n), where n can equal 0 or 1 (or 1 or 2).

ChemAxon 25dcd765a3

19-06-2006 13:20:47

Code:
UP|DOWN is not listed in your documentation. It should be.



You are right. It will be, as it is not obvious that UP | DOWN equals wavy.





Actually getNode1() getAtom1() gives the same object.


The main difference is that getAtom1() casts the object to MolAtom type (so it is slower).
Quote:
In fact, may I suggest that in place of getNode1, getNode2, getAtom1, and getAtom2, you should have new methods getNode(int n) and getAtom(int n), where n can equal 0 or 1 (or 1 or 2).
I can imagine reasons for both methods (getNode1, getNode(int n)) , but I let others to decide which one fits better to marvin's philosophy.

User 870ab5b546

19-06-2006 13:36:46

volfi wrote:
Actually getNode1() getAtom1() gives the same object.


The main difference is that getAtom1() casts the object to MolAtom type (so it is slower).
So the previous reply was incorrect? That is, getAtom1() will always return the atom to which the narrow end of the bond points?

ChemAxon a3d59b832c

20-06-2006 07:51:13

bobgr wrote:
That is, getAtom1() will always return the atom to which the narrow end of the bond points?
For dashed and wavy bonds: Yes, always.





For hashed (down) bonds, it depends on the setting in "Edit/Preferences/Bonds/Down wedge orientation" in the viewer/sketcher.





If it is set to default (MDL convention), the narrow end is returned by getAtom1() and getNode1(). For the Daylight convention, the hashed wedges are depicted in opposite order, so there getAtom2() and getNode2() will return the narrower end.





However, this is only a depiction convention option, the meaning of the molecule stays the same. So whatever depiction method is used, you can rely on getAtom1() returning the chiral atom at the "closer" end of the hashed bond.





I hope this helps, and sorry for the confusing answers.





Szabolcs