Content-Type: multipart/mixed; boundary="Apple-Mail=_D0787045-4A67-4F7F-801B-4473944A89D0" --Apple-Mail=_D0787045-4A67-4F7F-801B-4473944A89D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Egon,

Looks good=E2=80=A6 couple of minor tweaks I'd = suggest=E2=80=A6

- The class name is good = "*StereoElement*" but I'm thinking the enumeration of TOGETHER/OPPOSITE = is could be described better by 'conformation' rather then 'stereo'. I = guess the true name is = 'Stereo-conformation/configuration'... 

/=CB=88ster=C4=93-=C5=8D/

Noun:
  1. A sound system, typically = including a CD, tape, or record player, that has two or more speakers = and produces stereo = sound.
=

con=C2=B7for=C2=B7ma=C2=B7tion

=
- Other then that would be good to use a List<IBond> instead = of an IBond[] mainly as it simplifies the code. Also as I interrupt this = model only provides the connected bonds used to determine the = conformation i.e. if one of the double bond atoms has more then 1 ligand = you only store the higher priority.

- Might = good to consider how either could be specified perhaps it might be = another stereo-element class=E2=80=A6 not sure on this one.
- = I made the fields that can never be set immutable (as they should need = to be set this forces future modifiers to consider whether it really = should be = modified)

Cheers,
J

On 19 Sep 2012, at 13:40, Egon Willighagen <egon.willighagen@gmail.com&= gt; wrote:

Hi John, all,

attached is a patch with a data model = for the double bond
stereochemistry. Note that like the tetrahedral = chirality data model,
it is merely describing the stereochemistry in = terms of atoms, without
qualifying the stereochemistry in terms of = molecular wide
stereochemistry. That is, the double bond = stereochemistry describes
how the atoms (bonds) are grouped around = the double bond, but does not
say if that means it is E or Z. = Similarly, the tetrahedral chirality
specifies the geometry, but not = if it is R or S (or r, s).

As this patch just outlines the data = model, it does not add support
for reading or writing this = information from/to file formats yet. That
is up next.

Please = have a look at the data model and let me know your = comments.

Egon

PS. this patch is a result of the CDK = hackathon we had at the EBI
Mon/Tue, and more specifically = discussions I had with John.

--
Dr E.L. = Willighagen
Postdoctoral Researcher
Department of Bioinformatics - = BiGCaT
Maastricht University (http://www.bigcat.unimaas.nl/)<= br>Homepage: http://egonw.github.com/
LinkedIn= : http://se.linkedin.com/in/egonw
Blog:
http://chem-bla-ics.blogspot.co= m/
PubList: http://www.citeuli= ke.org/user/egonw/tag/papers
<0001-Added-a-data-model-for-= double-bond-stereochemistry.patch>

= --Apple-Mail=_D0787045-4A67-4F7F-801B-4473944A89D0 Content-Disposition: attachment; filename=0001-Using-List-instead-of-fixed-size-array.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Using-List-instead-of-fixed-size-array.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f33d55f03e7193752de3ff9b3834716715567f43=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20John=20May=20=0A= Date:=20Wed,=2019=20Sep=202012=2014:47:51=20+0100=0ASubject:=20[PATCH]=20= -=20Using=20List=20instead=20of=20fixed=20size=20array=20-=20Renamed=20= Stereo=20to=0A=20conformation=20(renamed=20method)=20-=20Made=20unstable=20= fields=0A=20immutable=20-=20Possible=20addition=20of=20Either/Unknown=0A=20= confirmation=0A=0A---=0A=20= .../cdk/interfaces/IDoubleBondStereochemistry.java=20|=20=20=2019=20= +++++++-----=0A=20.../cdk/stereo/DoubleBondStereochemistry.java=20=20=20=20= =20=20|=20=20=2031=20++++++++++---------=0A=20= .../cdk/stereo/DoubleBondStereochemistryTest.java=20=20|=20=20=2032=20= +++++++++++---------=0A=203=20files=20changed,=2045=20insertions(+),=20= 37=20deletions(-)=0A=0Adiff=20--git=20= a/src/main/org/openscience/cdk/interfaces/IDoubleBondStereochemistry.java=20= b/src/main/org/openscience/cdk/interfaces/IDoubleBondStereochemistry.java=0A= index=20eb7c55b..34248bd=20100644=0A---=20= a/src/main/org/openscience/cdk/interfaces/IDoubleBondStereochemistry.java=0A= +++=20= b/src/main/org/openscience/cdk/interfaces/IDoubleBondStereochemistry.java=0A= @@=20-22,6=20+22,8=20@@=0A=20=20*/=0A=20package=20= org.openscience.cdk.interfaces;=0A=20=0A+import=20java.util.List;=0A+=0A=20= /**=0A=20=20*=20Stereochemistry=20specification=20for=20double=20bond=20= stereochemistry.=20The=20data=20model=20defines=20the=20double=0A=20=20*=20= atoms=20and=20two=20ligands=20attached=20to=20those=20two=20atoms,=20= linearly=20connected=20with=20the=20double=20bond=20in=20the=0A@@=20= -29,7=20+31,7=20@@=20package=20org.openscience.cdk.interfaces;=0A=20=20*=20= are=20sorted=20according=20to=20the=20linear=20connectivity.=20Thus,=20= the=20first=20and=20third=20bonds=20are=20the=20two=0A=20=20*=20bonds=20= attached=20on=20either=20side=20of=20the=20double=20bond,=20and=20the=20= second=20bond=20is=20the=20double=20bond.=0A=20=20*=20The=20stereo=20= annotation=20then=20indicates=20if=20the=20ligand=20atoms=20are=20in=20= the=20cis=20position=0A-=20*=20({@link=20Stereo#TOGETHER})=20or=20in=20= the=20trans=20position=20({@link=20Stereo#OPPOSITE}),=20matching=20the=0A= +=20*=20({@link=20Conformation#TOGETHER})=20or=20in=20the=20trans=20= position=20({@link=20Conformation#OPPOSITE}),=20matching=20the=0A=20=20*=20= orientation=20of=20the=20methyls=20in=20but-2-ene=20respectively=20as=20= Z=20and=20E.=0A=20=20*=0A=20=20*=20@cdk.module=20= interfaces=0A@@=20-40,17=20+42,20=20@@=20public=20interface=20= IDoubleBondStereochemistry=20extends=20IStereoElement=20{=0A=20=20=20=20=20= /**=0A=20=20=20=20=20=20*=20Enumeration=20that=20defines=20the=20two=20= possible=20values=20for=20this=20stereochemistry=20type.=0A=20=20=20=20=20= =20*/=0A-=20=20=20=20public=20enum=20Stereo=20{=0A+=20=20=20=20public=20= enum=20Conformation=20{=0A=20=20=20=20=20=20=20=20=20TOGETHER,=0A-=20=20=20= =20=20=20=20=20OPPOSITE=0A+=20=20=20=20=20=20=20=20OPPOSITE,=0A+=20=20=20= =20=20=20=20=20//=20not=20sure=20if=20either/unknown=20are=20needed...=20= but=20it=20might=20be=20worth=20while=20thinking=20about=20how=20it=20= could=20be=20stored=0A+=20=20=20=20=20=20=20=20EITHER,=0A+=20=20=20=20=20= =20=20=20UNKNOWN=0A=20=20=20=20=20}=0A=20=0A=20=20=20=20=20/**=0A=20=20=20= =20=20=20*=20Returns=20an=20array=20of=20ligand=20bonds=20around=20the=20= double=20bond.=0A=20=20=20=20=20=20*=0A-=20=20=20=20=20*=20@return=20an=20= array=20of=20two=20{@link=20IBond}s.=0A+=20=20=20=20=20*=20@return=20a=20= list=20of=20two=20{@link=20IBond}s.=0A=20=20=20=20=20=20*/=0A-=20=20=20=20= public=20IBond[]=20getBonds();=0A+=20=20=20=20public=20List=20= getBonds();=0A=20=0A=20=20=20=20=20/**=0A=20=20=20=20=20=20*=20{@link=20= IBond}=20that=20is=20the=20stereo=20center.=0A@@=20-62,7=20+67,7=20@@=20= public=20interface=20IDoubleBondStereochemistry=20extends=20= IStereoElement=20{=0A=20=20=20=20=20/**=0A=20=20=20=20=20=20*=20Defines=20= the=20stereochemistry=20around=20the=20double=20bond.=0A=20=20=20=20=20=20= *=0A-=20=20=20=20=20*=20@return=20the=20{@link=20Stereo}=20for=20this=20= stereo=20element.=0A+=20=20=20=20=20*=20@return=20the=20{@link=20= IDoubleBondStereochemistry.Conformation}=20for=20this=20stereo=20= element.=0A=20=20=20=20=20=20*/=0A-=20=20=20=20public=20Stereo=20= getStereo();=0A+=20=20=20=20public=20Conformation=20getConformation();=0A= =20}=0Adiff=20--git=20= a/src/main/org/openscience/cdk/stereo/DoubleBondStereochemistry.java=20= b/src/main/org/openscience/cdk/stereo/DoubleBondStereochemistry.java=0A= index=20f9e8410..d796aaa=20100644=0A---=20= a/src/main/org/openscience/cdk/stereo/DoubleBondStereochemistry.java=0A= +++=20= b/src/main/org/openscience/cdk/stereo/DoubleBondStereochemistry.java=0A= @@=20-28,6=20+28,9=20@@=20import=20org.openscience.cdk.interfaces.IBond;=0A= =20import=20org.openscience.cdk.interfaces.IChemObjectBuilder;=0A=20= import=20org.openscience.cdk.interfaces.IDoubleBondStereochemistry;=0A=20= =0A+import=20java.util.Collections;=0A+import=20java.util.List;=0A+=0A=20= /**=0A=20=20*=20Stereochemistry=20specification=20for=20double=20bonds.=20= See=20{@link=20IDoubleBondStereochemistry}=20for=0A=20=20*=20further=20= details.=0A@@=20-36,22=20+39,22=20@@=20import=20= org.openscience.cdk.interfaces.IDoubleBondStereochemistry;=0A=20=20*=0A=20= =20*=20@see=20org.openscience.cdk.interfaces.IDoubleBondStereochemistry=0A= =20=20*/=0A= -@TestClass("org.openscience.cdk.stereo.DoubleBondStereochemistryTest")=0A= +@TestClass("org.openscience.cdk.conformation.DoubleBondStereochemistryTes= t")=0A=20public=20class=20DoubleBondStereochemistry=20implements=20= IDoubleBondStereochemistry=20{=0A=20=0A-=09private=20Stereo=20stereo;=0A= -=09private=20IBond[]=20ligandBonds;=0A-=09private=20IBond=20stereoBond;=0A= +=09private=20final=20Conformation=20conformation;=0A+=09private=20final=20= List=20bonds;=0A+=09private=20final=20IBond=20stereoBond;=0A=20=20= =20=20=20private=20IChemObjectBuilder=20builder;=0A=20=0A=20=09/**=0A-=09= =20*=20Creates=20a=20new=20double=20bond=20stereo=20chemistry.=20The=20= path=20of=20length=20three=20is=20defined=20by=0A+=09=20*=20Creates=20a=20= new=20double=20bond=20conformation=20chemistry.=20The=20path=20of=20= length=20three=20is=20defined=20by=0A=20=09=20*=20= ligandBonds[0],=20stereoBonds,=20and=20= ligandBonds[1].=0A=20=09=20*/=0A-=09public=20= DoubleBondStereochemistry(IBond=20stereoBond,=20IBond[]=20ligandBonds,=20= Stereo=20stereo)=20{=0A-=09=09this.stereoBond=20=3D=20stereoBond;=0A-=09=09= this.ligandBonds=20=3D=20ligandBonds;=0A-=09=09this.stereo=20=3D=20= stereo;=0A+=09public=20DoubleBondStereochemistry(IBond=20stereoBond,=20= List=20ligandBonds,=20Conformation=20conformation)=20{=0A+=09=09= this.stereoBond=20=20=20=3D=20stereoBond;=0A+=09=09this.bonds=20=20=20=20= =20=20=20=20=3D=20Collections.unmodifiableList(ligandBonds);=0A+=09=09= this.conformation=20=3D=20conformation;=0A=20=09}=0A=20=09=0A=20=20=20=20= =20/**=0A@@=20-73,10=20+76,8=20@@=20public=20class=20= DoubleBondStereochemistry=20implements=20IDoubleBondStereochemistry=20{=0A= =20=0A=20=09/**=20{@inheritDoc}=20*/=0A=20=09@Override=0A-=09public=20= IBond[]=20getBonds()=20{=0A-=09=09IBond[]=20arrayCopy=20=3D=20new=20= IBond[2];=0A-=20=20=20=20=20=20=20=20System.arraycopy(ligandBonds,=200,=20= arrayCopy,=200,=202);=0A-=20=20=20=20=20=20=20=20return=20arrayCopy;=0A+=09= public=20List=20getBonds()=20{=0A+=09=09return=20bonds;=0A=20=09}=0A= =20=0A=20=09/**=20{@inheritDoc}=20*/=0A@@=20-87,8=20+88,8=20@@=20public=20= class=20DoubleBondStereochemistry=20implements=20= IDoubleBondStereochemistry=20{=0A=20=0A=20=09/**=20{@inheritDoc}=20*/=0A=20= =09@Override=0A-=09public=20Stereo=20getStereo()=20{=0A-=09=09return=20= this.stereo;=0A+=09public=20Conformation=20getConformation()=20{=0A+=09=09= return=20this.conformation;=0A=20=09}=0A=20=0A=20}=0Adiff=20--git=20= a/src/test/org/openscience/cdk/stereo/DoubleBondStereochemistryTest.java=20= b/src/test/org/openscience/cdk/stereo/DoubleBondStereochemistryTest.java=0A= index=207b47d8a..ddb56d6=20100644=0A---=20= a/src/test/org/openscience/cdk/stereo/DoubleBondStereochemistryTest.java=0A= +++=20= b/src/test/org/openscience/cdk/stereo/DoubleBondStereochemistryTest.java=0A= @@=20-32,7=20+32,12=20@@=20import=20= org.openscience.cdk.DefaultChemObjectBuilder;=0A=20import=20= org.openscience.cdk.interfaces.IAtomContainer;=0A=20import=20= org.openscience.cdk.interfaces.IBond;=0A=20import=20= org.openscience.cdk.interfaces.IBond.Order;=0A-import=20= org.openscience.cdk.interfaces.IDoubleBondStereochemistry.Stereo;=0A= +import=20org.openscience.cdk.interfaces.IDoubleBondStereochemistry;=0A+=0A= +import=20java.util.Arrays;=0A+import=20java.util.List;=0A+=0A+import=20= org.openscience.cdk.interfaces.IDoubleBondStereochemistry.Conformation;=0A= =20=0A=20/**=0A=20=20*=20@cdk.module=20test-core=0A@@=20-40,7=20+45,7=20= @@=20import=20= org.openscience.cdk.interfaces.IDoubleBondStereochemistry.Stereo;=0A=20= public=20class=20DoubleBondStereochemistryTest=20extends=20CDKTestCase=20= {=0A=20=0A=20=20=20=20=20private=20static=20IAtomContainer=20molecule;=0A= -=20=20=20=20private=20static=20IBond[]=20ligands;=0A+=20=20=20=20= private=20static=20List=20ligands;=0A=20=0A=20=20=20=20=20/**=0A=20= =20=20=20=20=20*=20This=20method=20creates=20E-but-2-ene.=0A@@=20= -55,16=20+60,13=20@@=20public=20class=20DoubleBondStereochemistryTest=20= extends=20CDKTestCase=20{=0A=20=20=20=20=20=20=20=20=20= molecule.addBond(0,=201,=20Order.SINGLE);=0A=20=20=20=20=20=20=20=20=20= molecule.addBond(1,=202,=20Order.DOUBLE);=0A=20=20=20=20=20=20=20=20=20= molecule.addBond(2,=203,=20Order.SINGLE);=0A-=20=20=20=20=20=20=20=20= ligands=20=3D=20new=20IBond[]=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20= molecule.getBond(0),=0A-=20=20=20=20=20=20=20=20=20=20=20=20= molecule.getBond(2)=0A-=20=20=20=20=20=20=20=20};=0A+=20=20=20=20=20=20=20= =20ligands=20=3D=20Arrays.asList(molecule.getBond(0),=20= molecule.getBond(2));=0A=20=20=20=20=20}=0A=20=0A=20=20=20=20=20@Test=0A=20= =20=20=20=20public=20void=20testConstructor()=20{=0A=20=20=20=20=20=20=20= =20=20DoubleBondStereochemistry=20stereo=20=3D=20new=20= DoubleBondStereochemistry(=0A-=20=20=20=20=20=20=20=20=20=20=20=20= molecule.getBond(1),=20ligands,=20Stereo.OPPOSITE=0A+=20=20=20=20=20=20=20= =20=20=20=20=20molecule.getBond(1),=20ligands,=20Conformation.OPPOSITE=0A= =20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20= Assert.assertNotNull(stereo);=0A=20=20=20=20=20}=0A@@=20-72,7=20+74,7=20= @@=20public=20class=20DoubleBondStereochemistryTest=20extends=20= CDKTestCase=20{=0A=20=20=20=20=20@Test=0A=20=20=20=20=20public=20void=20= testBuilder()=20{=0A=20=20=20=20=20=20=20=20=20DoubleBondStereochemistry=20= stereo=20=3D=20new=20DoubleBondStereochemistry(=0A-=20=20=20=20=20=20=20=20= =20=20=20=20molecule.getBond(1),=20ligands,=20Stereo.OPPOSITE=0A+=20=20=20= =20=20=20=20=20=20=20=20=20molecule.getBond(1),=20ligands,=20= IDoubleBondStereochemistry.Conformation.OPPOSITE=0A=20=20=20=20=20=20=20=20= =20);=0A=20=20=20=20=20=20=20=20=20= Assert.assertNull(stereo.getBuilder());=0A=20=20=20=20=20=20=20=20=20= stereo.setBuilder(DefaultChemObjectBuilder.getInstance());=0A@@=20-85,7=20= +87,7=20@@=20public=20class=20DoubleBondStereochemistryTest=20extends=20= CDKTestCase=20{=0A=20=20=20=20=20@Test=0A=20=20=20=20=20public=20void=20= testGetStereoBond()=20{=0A=20=20=20=20=20=20=20=20=20= DoubleBondStereochemistry=20stereo=20=3D=20new=20= DoubleBondStereochemistry(=0A-=20=20=20=20=20=20=20=20=20=20=20=20= molecule.getBond(1),=20ligands,=20Stereo.OPPOSITE=0A+=20=20=20=20=20=20=20= =20=20=20=20=20molecule.getBond(1),=20ligands,=20Conformation.OPPOSITE=0A= =20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20= Assert.assertNotNull(stereo);=0A=20=20=20=20=20=20=20=20=20= Assert.assertEquals(molecule.getBond(1),=20stereo.getStereoBond());=0A@@=20= -94,27=20+96,27=20@@=20public=20class=20DoubleBondStereochemistryTest=20= extends=20CDKTestCase=20{=0A=20=20=20=20=20@Test=0A=20=20=20=20=20public=20= void=20testGetStereo()=20{=0A=20=20=20=20=20=20=20=20=20= DoubleBondStereochemistry=20stereo=20=3D=20new=20= DoubleBondStereochemistry(=0A-=20=20=20=20=20=20=20=20=20=20=20=20= molecule.getBond(1),=20ligands,=20Stereo.OPPOSITE=0A+=20=20=20=20=20=20=20= =20=20=20=20=20molecule.getBond(1),=20ligands,=20Conformation.OPPOSITE=0A= =20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20= Assert.assertNotNull(stereo);=0A-=20=20=20=20=20=20=20=20= Assert.assertEquals(Stereo.OPPOSITE,=20stereo.getStereo());=0A+=20=20=20=20= =20=20=20=20Assert.assertEquals(Conformation.OPPOSITE,=20= stereo.getConformation());=0A=20=20=20=20=20}=0A=20=0A=20=20=20=20=20= @Test=0A=20=20=20=20=20public=20void=20testGetBonds()=20{=0A=20=20=20=20=20= =20=20=20=20DoubleBondStereochemistry=20stereo=20=3D=20new=20= DoubleBondStereochemistry(=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20molecule.getBond(1),=20ligands,=20Stereo.OPPOSITE=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20molecule.getBond(1),=20ligands,=20= Conformation.OPPOSITE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20= =20=20=20=20=20=20=20Assert.assertNotNull(stereo);=0A-=20=20=20=20=20=20=20= =20for=20(int=20i=3D0;=20i
--Apple-Mail=_D0787045-4A67-4F7F-801B-4473944A89D0--
  1. The shape or structure of = something, esp. an animal.
  2. Any of the spatial = arrangements that the atoms in a molecule may adopt and freely convert = between, esp. by rotation about = individual...