User 953c0d67b0
05-03-2006 23:55:17
I have been using the following code to read mrv documents into my
program:
Molecule molecule = MolImporter.importMol(marvinString);
But now it is throwing an IO exception:
Line 135: java.io.IOException: cannot find atom "m1.a19"
(value of marvinString is below)
According to API for MolImporter, it only reads one <molecule>
from a document; my document has super groups in several
molecules.
What is the best way to import such a document into a java program?
I haven't found a simple IMPORT for this one...perhaps I need a
loop to import each <molecule> individually????
Thanks,
Kevin
========================
program:
Molecule molecule = MolImporter.importMol(marvinString);
But now it is throwing an IO exception:
Line 135: java.io.IOException: cannot find atom "m1.a19"
(value of marvinString is below)
According to API for MolImporter, it only reads one <molecule>
from a document; my document has super groups in several
molecules.
What is the best way to import such a document into a java program?
I haven't found a simple IMPORT for this one...perhaps I need a
loop to import each <molecule> individually????
Thanks,
Kevin
========================
Code: |
<?xml version="1.0" encoding="Cp1252" ?> <MDocument> <MChemicalStruct> <molecule molID="m1"> <atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15" elementType="Sn R R R Br C C C C C Sn R R R H" radical="0 0 0 0 0 0 0 0 0 monovalent 0 0 0 0 0" sgroupRef="0 sg1 sg2 sg3 0 0 0 0 0 0 0 sg4 sg5 sg6 0" x2="0.2069748081171232 -0.5630251918828764 -1.2805509643680422 0.2069748081171232 0.9500015423357207 4.640308178951712 3.3066681789517123 5.973948178951712 5.973948178951712 3.3066681789517123 2.2278995215510182 1.4578995215510187 0.7403737490658528 2.2278995215510182 2.7670559130008465" y2="2.6433452152856667 3.9770243371137024 2.244763885827785 1.1033452152856675 4.631345173562416 1.9363451020368423 4.246345102036843 4.246345102036843 2.706345102036842 2.706345102036842 -0.9766195382084515 0.35705958361958423 -1.375200867666333 -2.5166195382084506 0.46591655685426825" /> <bondArray> <bond atomRefs2="a1 a5" order="1" /> <bond atomRefs2="a6 a10" order="1" /> <bond atomRefs2="a6 a9" order="1" /> <bond atomRefs2="a10 a7" order="1" /> <bond atomRefs2="a7 a8" order="1" /> <bond atomRefs2="a8 a9" order="1" /> <bond atomRefs2="a11 a15" order="1" /> <bond atomRefs2="a1 a2" order="1" /> <bond atomRefs2="a1 a3" order="1" /> <bond atomRefs2="a1 a4" order="1" /> <bond atomRefs2="a11 a12" order="1" /> <bond atomRefs2="a11 a13" order="1" /> <bond atomRefs2="a11 a14" order="1" /> </bondArray> <molecule id="sg1" role="SuperatomSgroup" title="Bu" molID="m2"> <atomArray atomID="a16 a17 a18 a19" elementType="C C C C" attachmentPoint="1 0 0 0" x2="1.3324934908591768 -0.0011856309688580424 -1.3348647527968938 -2.6685438746249295" y2="4.486678498948464 3.716678498948463 4.4866784989484625 3.716678498948463" /> <bondArray> <bond atomRefs2="a16 a17" order="1" /> <bond atomRefs2="a17 a18" order="1" /> <bond atomRefs2="a18 a19" order="1" /> </bondArray> </molecule> <molecule id="sg2" role="SuperatomSgroup" title="Bu" molID="m3"> <atomArray atomID="a20 a21 a22 a23" elementType="C C C C" attachmentPoint="1 0 0 0" x2="0.574160284682419 -0.7595188371456159 -2.0931979589736516 -3.4268770808016873" y2="2.7950118884095048 2.0250118884095034 2.795011888409503 2.0250118884095034" /> <bondArray> <bond atomRefs2="a20 a21" order="1" /> <bond atomRefs2="a21 a22" order="1" /> <bond atomRefs2="a22 a23" order="1" /> </bondArray> </molecule> <molecule id="sg3" role="SuperatomSgroup" title="Bu" molID="m4"> <atomArray atomID="a24 a25 a26 a27" elementType="C C C C" attachmentPoint="1 0 0 0" x2="2.0324937769614717 0.6988146551334369 -0.6348644666945988 -1.9685435885226346" y2="1.7450118839391564 0.975011883939155 1.7450118839391546 0.975011883939155" /> <bondArray> <bond atomRefs2="a24 a25" order="1" /> <bond atomRefs2="a25 a26" order="1" /> <bond atomRefs2="a26 a27" order="1" /> </bondArray> </molecule> <molecule id="sg4" role="SuperatomSgroup" title="Bu" molID="m5"> <atomArray atomID="a28 a29 a30 a31" elementType="C C C C" attachmentPoint="1 0 0 0" x2="3.3534182042930727 2.019739082465037 0.6860599606370013 -0.647619161191034" y2="0.8667137454543461 0.09671374545434475 0.8667137454543443 0.09671374545434475" /> <bondArray> <bond atomRefs2="a28 a29" order="1" /> <bond atomRefs2="a29 a30" order="1" /> <bond atomRefs2="a30 a31" order="1" /> </bondArray> </molecule> <molecule id="sg5" role="SuperatomSgroup" title="Bu" molID="m6"> <atomArray atomID="a32 a33 a34 a35" elementType="C C C C" attachmentPoint="1 0 0 0" x2="2.595084998116315 1.2614058762882792 -0.07227324553975611 -1.4059523673677918" y2="-0.8249528650846134 -1.5949528650846148 -0.8249528650846152 -1.5949528650846148" /> <bondArray> <bond atomRefs2="a32 a33" order="1" /> <bond atomRefs2="a33 a34" order="1" /> <bond atomRefs2="a34 a35" order="1" /> </bondArray> </molecule> <molecule id="sg6" role="SuperatomSgroup" title="Bu" molID="m7"> <atomArray atomID="a36 a37 a38 a39" elementType="C C C C" attachmentPoint="1 0 0 0" x2="4.053418490395368 2.719739368567332 1.3860602467392962 0.0523811249112609" y2="-1.8749528695549618 -2.644952869554963 -1.8749528695549635 -2.644952869554963" /> <bondArray> <bond atomRefs2="a36 a37" order="1" /> <bond atomRefs2="a37 a38" order="1" /> <bond atomRefs2="a38 a39" order="1" /> </bondArray> </molecule> </molecule> </MChemicalStruct> <MEFlow arcAngle="206.91" headSkip="0.15" headFlags="2" headLength="0.5" headWidth="0.4" tailSkip="0.25"> <MAtomSetPoint atomRefs="m1.a19" /> <MAtomSetPoint atomRefs="m1.a19 m1.a24" /> </MEFlow> <MEFlow arcAngle="-150.0" headSkip="0.15" headFlags="2" headLength="0.5" headWidth="0.4" tailSkip="0.15"> <MAtomSetPoint atomRefs="m1.a20 m1.a24" /> <MAtomSetPoint atomRefs="m1.a19 m1.a24" /> </MEFlow> <MEFlow arcAngle="248.39738999999997" headSkip="0.25" headFlags="2" headLength="0.5" headWidth="0.4" tailSkip="0.15"> <MAtomSetPoint atomRefs="m1.a20 m1.a24" /> <MAtomSetPoint atomRefs="m1.a20" /> </MEFlow> <MRectangle> <MPoint x="-1.7763582691645903" y="5.151678451264747" /> <MPoint x="6.681974865486595" y="5.151678451264747" /> <MPoint x="6.681974865486595" y="-3.4233215964189685" /> <MPoint x="-1.7763582691645903" y="-3.4233215964189685" /> </MRectangle> </MDocument> |