clean()

User 870ab5b546

24-07-2006 21:54:24

Consider this compound:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7 a8"


          elementType="C C C C C O H H"


          formalCharge="0 0 0 -1 0 1 0 0"


          radical="0 0 0 0 0 divalent1 0 0"


          x2="-5.3846164053109735 -4.908753987923751 -3.368746164664138 -2.5987499952316284 -4.138750076293945 -4.138750076293945 -6.593124969005585 -6.641250014305115"


          y2="-0.3652243246609572 -1.8297717645808484 -1.8297717645808484 -0.38499993085861206 0.539992273851043 2.079992273851043 0.57750004529953 -0.14437501311302192"


          />


      <bondArray>


        <bond atomRefs2="a5 a1" order="1" />


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="1" />


        <bond atomRefs2="a5 a4" order="2" />


        <bond atomRefs2="a5 a6" order="1" />


        <bond atomRefs2="a4 a7" order="1" />


        <bond atomRefs2="a4 a8" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>








When I highlight the two H atoms and the negatively charged C, then choose Clean2D, the H atoms move nicely, and the C atom does not. However, if I put those same three atoms in a SelectionMolecule and then do a clean(2, "O1") on the SelectionMolecule, the C and H atoms move much further away from the other atoms in the molecule, as shown below. How do I change the Java behavior to be the same as the applet behavior?





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7 a8"


          elementType="C C C C C O H H"


          formalCharge="0 0 0 -1 0 1 0 0"


          radical="0 0 0 0 0 divalent1 0 0"


          x2="-5.2883663480905145 -4.812503930703292 -3.272496107443679 0.0 -4.042500019073486 -4.042500019073486 3.08 0.0"


          y2="0.26040065984183514 -1.204146780078056 -1.204146780078056 0.0 1.1656172583538353 2.7056172583538354 0.0 -3.08"


          />


      <bondArray>


        <bond atomRefs2="a5 a1" order="1" />


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="1" />


        <bond atomRefs2="a5 a4" order="2" />


        <bond atomRefs2="a5 a6" order="1" />


        <bond atomRefs2="a4 a7" order="1" />


        <bond atomRefs2="a4 a8" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


</MDocument>


User 870ab5b546

25-07-2006 15:59:58

Starting with this molecule:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7 a8"


          elementType="C C C C C O H H"


          formalCharge="0 0 0 -1 0 1 0 0"


          radical="0 0 0 0 0 divalent1 0 0"


          x2="-3.416874885559082 -4.66274121457611 -4.1868787971888874 -2.646870973929275 -2.1710085565420543 -0.6834827840568891 0.0 0.0"


          y2="1.6949922452408135 0.7897756467288133 -0.6747717931910779 -0.6747717931910779 0.7897756467288133 1.1883569761866952 0.0 0.0"


          />


      <bondArray>


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="1" />


        <bond atomRefs2="a4 a5" order="2" />


        <bond atomRefs2="a1 a5" order="1" />


        <bond atomRefs2="a5 a6" order="1" />


        <bond atomRefs2="a4 a7" order="1" />


        <bond atomRefs2="a4 a8" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


  <MEFlow arcAngle="171.0" headSkip="0.15" headLength="0.5" headWidth="0.4"


          tailSkip="0.15">


    <MAtomSetPoint atomRefs="m1.a5 m1.a6" />


    <MAtomSetPoint atomRefs="m1.a4 m1.a5" />


  </MEFlow>


</MDocument>








Atoms C4, H7, H8 added to SelectionMolecule toClean.





toClean.clean(2, "O0");





Product of this clean command:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7 a8"


          elementType="C C C C C O H H"


          formalCharge="0 0 0 -1 0 1 0 0"


          radical="0 0 0 0 0 divalent1 0 0"


          x2="-3.416874885559082 -4.66274121457611 -4.1868787971888874 0.0 -2.1710085565420543 -0.6834827840568891 3.08 0.0"


          y2="1.6949922452408135 0.7897756467288133 -0.6747717931910779 0.0 0.7897756467288133 1.1883569761866952 0.0 -3.08"


          />


      <bondArray>


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="1" />


        <bond atomRefs2="a4 a5" order="2" />


        <bond atomRefs2="a1 a5" order="1" />


        <bond atomRefs2="a5 a6" order="1" />


        <bond atomRefs2="a4 a7" order="1" />


        <bond atomRefs2="a4 a8" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


  <MEFlow arcAngle="171.0" headSkip="0.15" headLength="0.5" headWidth="0.4"


          tailSkip="0.15">


    <MAtomSetPoint atomRefs="m1.a5 m1.a6" />


    <MAtomSetPoint atomRefs="m1.a4 m1.a5" />


  </MEFlow>


</MDocument>








Product of clean command in Marvin after highlighting the same three atoms:





Code:
<?xml version="1.0" ?>


<MDocument>


  <MChemicalStruct>


    <molecule molID="m1">


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7 a8"


          elementType="C C C C C O H H"


          formalCharge="0 0 0 -1 0 1 0 0"


          radical="0 0 0 0 0 divalent1 0 0"


          x2="-3.416874885559082 -4.66274121457611 -4.1868787971888874 -2.646878797476192 -2.1710085565420543 -0.6834827840568891 -1.4139213110265527 -2.1502830884586897"


          y2="1.6949922452408135 0.7897756467288133 -0.6747717931910779 -0.6748015404123422 0.7897756467288133 1.1883569761866952 -1.5975235118684181 -2.1325370108545636"


          />


      <bondArray>


        <bond atomRefs2="a1 a2" order="1" />


        <bond atomRefs2="a2 a3" order="1" />


        <bond atomRefs2="a3 a4" order="1" />


        <bond atomRefs2="a4 a5" order="2" />


        <bond atomRefs2="a1 a5" order="1" />


        <bond atomRefs2="a5 a6" order="1" />


        <bond atomRefs2="a4 a7" order="1" />


        <bond atomRefs2="a4 a8" order="1" />


      </bondArray>


    </molecule>


  </MChemicalStruct>


  <MEFlow arcAngle="171.0" headSkip="0.15" headLength="0.5" headWidth="0.4"


          tailSkip="0.15">


    <MAtomSetPoint atomRefs="m1.a5 m1.a6" />


    <MAtomSetPoint atomRefs="m1.a4 m1.a5" />


  </MEFlow>


</MDocument>








I have tried adding the C4-H7 and C4-H8 bonds to toClean, as well as adding all the bonds to C4, but no joy -- the product molecule is still hopelessly distorted. Any ideas?

ChemAxon 25dcd765a3

26-07-2006 07:52:52

We examine the problem. However we are working on a new clean code so we'll see if the fix is easier in the old or in the new code.


How urgent is this for you?

User 870ab5b546

26-07-2006 11:35:13

volfi wrote:
We examine the problem. However we are working on a new clean code so we'll see if the fix is easier in the old or in the new code.


How urgent is this for you?
Not very. Take your time on this one.