<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Feb 28, 2006, at 9:28 AM, Thomas Goddard wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="4" style="font: 14.0px Monaco"><SPAN class="Apple-converted-space"> </SPAN>The PDB file reader is implemented in C++ and I believe there is no</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="4" style="font: 14.0px Monaco">Python interface to read from a string.<SPAN class="Apple-converted-space"> </SPAN>The C++ code can read from a</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="4" style="font: 14.0px Monaco">C++ stream (which could be a string stream), but there does not appear</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="4" style="font: 14.0px Monaco">to be a Python interface.<SPAN class="Apple-converted-space"> </SPAN>I'd suggest requesting this feature in an</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Monaco" size="4" style="font: 14.0px Monaco">email to <A href="mailto:chimera-bugs@cgl.ucsf.edu">chimera-bugs@cgl.ucsf.edu</A> (also used for new feature requests).</FONT></P> </BLOCKQUOTE><BR></DIV><DIV>I second Tom's idea of requesting the feature via chimera-bugs.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It would seem that you have the molecular data of interest internal to your extension rather than in an external file. What you can do is construct a Molecule directly rather than via a PDB file. Here's example code that constructs a model of a single water molecule:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>---</DIV><DIV>import chimera</DIV><DIV>H = chimera.Element("H")</DIV><DIV>O = chimera.Element("O")</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>m = chimera.Molecule()</DIV><DIV>m.name = "my water" # used by the Model Panel</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>r = m.newResidue("HOH", "water", 1, "") # name, chain, position, insertion code</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>o = m.newAtom("O", O) # name, element</DIV><DIV>h1 = m.newAtom("H1", H)</DIV><DIV>h2 = m.newAtom("H2", H)</DIV><DIV>for a in [o, h1, h2]:</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>r.addAtom(a)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>o.setCoord(chimera.Point(35.713, 15.029, 104.298))</DIV><DIV>h1.setCoord(chimera.Point(36.2803, 15.2855, 105.025))</DIV><DIV>h2.setCoord(chimera.Point(34.848, 15.4221, 104.414))</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>m.newBond(o, h1)</DIV><DIV>m.newBond(o, h2)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>chimera.openModels.add([m])</DIV><DIV>---</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>If you didn't want to have to explicitly specify connectivity, you could call "chimera.connectMolecule(m)" in place of the newBond() calls, which would have Chimera add bonds based on distance.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--Eric</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR></BODY></HTML>