atoms and graphical lines

User 870ab5b546

27-09-2011 17:07:14

I would like to be able to connect a graphical line to an atom.  Furthermore, I would like the graphical line to count as one of the substituents of the atom.  For example, if the atom is C, and it has no other ligands, it would appear as CH3.

ChemAxon 990acf0dec

27-09-2011 20:26:11

Hi Bob,


Until we implement this feature, how about the solution in the attached file?


Regards,


Akos

User 870ab5b546

27-09-2011 20:35:37

For that approach, I would need an alias or pseudoatom that is completely transparent, so I can attach other bonds to it, and so it doesn't obscure other objects.  See the figure below; I would need an invisible atom at the center and where each of the bonds in the back meets the circle.


<?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5 a6"
elementType="H H H H H H"
mrvValence="0 0 0 0 0 0"
x2="-1.0507292250792184 1.3073958655198417 1.307395746310552 -1.0507291654745736 -3.408854196468989 -3.4569792250792184"
y2="3.8820833067099256 2.293958316246669 -0.44916670521100355 -1.7966667314370472 -0.4010416169961293 2.2458332876364393"
/>
<bondArray>
</bondArray>
</molecule>
</MChemicalStruct>
<MPolyline id="o2">
<MPoint x="-1.0507291654745736" y="0.9464583198229473" />
<MPoint x="-3.030738320851031" y="2.0896171386774687" />
</MPolyline>
<MPolyline id="o3">
<MPoint x="-1.0507291654745736" y="0.9464583198229473" />
<MPoint x="-1.0507291654745736" y="-1.3281798363931945" />
</MPolyline>
<MPolyline id="o4">
<MPoint x="-1.0507291654745736" y="0.9464583198229473" />
<MPoint x="0.8691507312805576" y="2.0549014950262747" />
</MPolyline>
<MEllipse id="o5" background="#ffffff" lineColor="#000000">
<MPoint x="-2.2057293752829232" y="2.0533332924048104" />
<MPoint x="0.10427068670590767" y="2.0533332924048104" />
<MPoint x="0.10427068670590767" y="-0.16041662295659376" />
<MPoint x="-2.2057293752829232" y="-0.16041662295659376" />
</MEllipse>
<MPolyline id="o6">
<MPoint x="-1.0507291654745736" y="0.9464583198229473" />
<MPoint x="0.8038952820803072" y="-0.11686467079576346" />
</MPolyline>
<MPolyline id="o7">
<MPoint x="-1.0507291654745736" y="0.9464583198229473" />
<MPoint x="-2.993543133497497" y="-0.17522584760045268" />
</MPolyline>
<MPolyline id="o8">
<MPoint x="-1.0507291654745736" y="0.9464583198229473" />
<MPoint x="-1.0507291654745736" y="3.456351192796947" />
</MPolyline>
</MDocument>
</cml>

ChemAxon 990acf0dec

29-09-2011 08:55:56

I see. OK, I discuss it with the developers to punderstand how much work it would be, and come back with the info soon.


Best regards,


Akos

ChemAxon 990acf0dec

29-09-2011 09:10:34

Would it solve your problem if we implement a feature to be able to set the atom label visibility not just globally, but one by one, for each atom?

User 870ab5b546

29-09-2011 23:26:54

I think that would probably work for me.

ChemAxon f052bdfe3c

13-02-2012 16:39:46

 Do
I understand correctly that you would like to have a transparent atom like the
one on the picture bellow?


Efi Hoffmann

User 870ab5b546

13-02-2012 16:53:40

Not really.  It's not transparent, because it obscures what's behind it.


Look, I want to be able to draw a Newman projection that looks like a Newman projection.  To do so, I need to have graphical lines that, when connected to an atom, satisfy one of the atom's valences.  Mucking with the visibility or transparency of atom labels isn't going to work well.

ChemAxon f052bdfe3c

15-02-2012 21:06:55

Sorry, I am not sure that I am completely understand the problem. (The mrv file you sent looks like a real Newman projection to me.) Do you want the invisible atom just for drawing Newman projection, or is it needed for something else as well?


I am thinking about it and please let me know if you have some idea how we could make it work.

User 870ab5b546

15-02-2012 22:10:16

The problem with the drawing I pasted above is that I had to set the valence property of every atom "attached" to the lines of the Newman projection.  Students will be altering this structure by changing the H atoms into other atoms such as C, and the valences of the new atoms will be wrong, i.e., a methyl group will be displayed as CH4, not CH3.


I wrote a Javascript method that watches for the user changing any of the six atoms "attached" to the lines of the Newman projection.  The method alters the valence of the changed atom to the correct number.  But the Javascript listener affects the responsiveness of the applet.


It would be much more convenient if we didn't have to alter the valence property.  If Marvin counted graphical lines toward the valences of the atoms, the problem would be solved.  


If that's not convenient, the alternative is to put an invisible atom where three of the lines terminate at the circle, and to change those three lines into real bonds.  

ChemAxon f052bdfe3c

22-02-2012 21:21:02

Sorry for the late answer, I needed time to think about it. How would the following solution work for you?


<?xml version="1.0"?>
<cml version="ChemAxon file format v5.9.0, generated by v5.9.0">
<MDocument>
  <MEllipse id="o1">
    <MPoint x="0.3876398474121192" y="0.3632200762939526"/>
    <MPoint x="1.2401404053115943" y="0.3632200762939526"/>
    <MPoint x="1.2401404053115943" y="-0.5167797997283863"/>
    <MPoint x="0.3876398474121192" y="-0.5167797997283863"/>
  </MEllipse>
  <MChemicalStruct>
    <molecule molID="m1">
      <atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8" elementType="C C H H H H H H" mrvValence="- 4 - - - - - -" mrvAlias="0 \u0020 0 0 0 0 0 0" x3="0.8087771078644337 0.778953468886725 2.2327964279558 0.19126315920984283 -0.05881400725725234 -0.7000659902198645 1.341467350121369 1.5915444311062468" y3="-0.08431630646459229 -0.06754638265561996 -0.23561637913931413 1.2295029385099274 -1.2706340509846932 0.16625363410813046 -1.2988657160216701 1.2012712562660433" z3="0.9438075191826176 -0.6727702328477688 -1.2519898769599767 -1.3433562129609582 -1.2455952855297023 1.5230271450547614 1.6143934609408603 1.5166324700082723"/>
      <bondArray>
        <bond atomRefs2="a1 a2" order="1"/>
        <bond atomRefs2="a2 a3" order="1"/>
        <bond atomRefs2="a2 a4" order="1"/>
        <bond atomRefs2="a2 a5" order="1"/>
        <bond atomRefs2="a1 a6" order="1"/>
        <bond atomRefs2="a1 a7" order="1"/>
        <bond atomRefs2="a1 a8" order="1"/>
      </bondArray>
    </molecule>
  </MChemicalStruct>
</MDocument>
</cml>

User 870ab5b546

23-02-2012 00:36:50

I think that's perfect!  I'll have to play around with it a bit, though.

User 870ab5b546

23-02-2012 18:31:45

You solved my problem much mroe efficiently than I thought was possible.  Thanks for your help!

ChemAxon f052bdfe3c

26-02-2012 19:53:41

I am glad that it works well.

User 870ab5b546

29-10-2014 19:44:35

With the recent Java versions, the C-H bonds in the back were extending into the circle of the Newman projection, so I had to adjust your solution. I did it by changing the space character to a larger one and then increasing its font size. There's still a problem, though, with the display. In the attached image, the structure on the right is the image that the cursor carries after I press the Newman projection template button. The structure on the left is what I get after I paste the template on the canvas. Note the red ends of the bonds that extend into the ellipse. What is causing those red ends, and can you remove them?

ChemAxon d26931946c

10-11-2014 11:25:43

We could not reproduce this behaviour. Could you attach your modified template file?

User 870ab5b546

10-11-2014 14:19:21

I'm attaching the template file. Use this page to reproduce the behavior.


I see bloody stumps on the C-H bonds in the back of the Newman projection when I use the toolbar button to place a single Newman projection on the page. If instead, I copy the MRV from the template file and paste it into the Marvin window, then I don't see the bloody stumps. 


If I first use the toolbar button, then paste the MRV from the file so that I have two Newman projections, then I see bloody stumps in both of them. But if I reverse these two steps, then I don't see bloody stumps.


Using Safari 7.1 on MacOS 10.9.5.

ChemAxon d26931946c

10-11-2014 14:31:36

Yes, it does not work well in the page you've linked in.


However removing the atom coloring from the file seems to solve the issue.


Change all values in the mrvSetSeq property to 0.


See the attached file. As there is no real coloring in the molecule, you can remove it from the template too.


 


We will look into this issue to fix the real cause of it.

User 870ab5b546

10-11-2014 14:44:51

Your example is still giving me the bloody stumps. See screen shot.


Also, your example removes the font size information. I need the font size information to make the \u2002 alias of the C atom in the back to be large enough that the C–H bonds don't extend inside the ellipse. Unless you want to implement a background color feature for the ellipse, so that it obscures the bonds and atoms behind it?

ChemAxon d26931946c

12-11-2014 07:45:31

Yes, this is very strange. We are still investigating this.


 


The thing is:


If you put down of this molecule and the go to edit->source and change the atomSetRGB from 1:D to 1:N, then the lines become black from red. But the interesting part is, that after this if you put down any more templates, they are working fine!

User 870ab5b546

26-03-2015 14:12:41

Any progress on fixing this display bug? It actually appears to be a little worse than before; the central C-C bond is no partly showing up as a bloody stump as well, and the second placement of the Newman projection continues to show the bloody stumps. (The third structure in the image below is the one carried by the cursor after I press the template button.) Using Marvin 15.2.16.

ChemAxon 2c555f5717

26-03-2015 16:26:38

Unfortunately no progress has been made since last time.

User 870ab5b546

26-03-2015 20:13:47

As you can see from this forum post, I am not the only person interested in this problem.

User 870ab5b546

27-03-2015 15:06:03

I downloaded the latest MarvinSketch, 15.3.23.0, and the bloody stumps have shrunk dramatically, to the point where they're no longer a problem. So, congratulations on making progress on the bug without realizing it!

ChemAxon f052bdfe3c

27-03-2015 19:20:11

I am glad it is better, and I think it is the result of an overall rewriting of bond drawing. Although, I am afraid, I have to disagree. I think it is still a problem (at least from my point of view).


Regards,


Efi