option to turn charge autocalc off

User 62a37f4796

18-07-2011 19:21:25

I'm returning to a topic I posted many moons ago.


I know there is some reasoning behind automatically calculating (and displaying) formal charges on H and N atoms, but I don't want my students to have access to this crutch.


What's more, the calculations are done inconsistently.


As I was writing a question about resonance in nitromethane, I set up a template with atom mapping turned on. When I added a double bond to one structure the N automatically received a + (4-bonds .. so it must be charged, right?) but the other one (using the exact same structure) did not (4-bonds .. but no charge; what is the reasoning behind that?).


Tangentially, if you are going to keep autocalc charges around it should take all
explicitly assigned lone pairs and radical electrons into account.
Adding a lone pair to the N in the above example, as some students might
try, does not change the charge when it should. Students ought to know
that adding/subtracting electrons changes their oxidation number/charge,
but the GUI is giving them conflicting information. I'm pretty sure
that students who already find the concept challenging will be
completely baffled by the application's behavior.


Overall I would much prefer that this "feature" is turned off so students will have to reason on their own which atoms deserve charges and which don't.


I can understand that you may not want that to be the default behavior (though you should fix the peculiar behavior seen here), but can I at least have the option of suppressing this?


Thanks.

ChemAxon d26931946c

20-07-2011 13:48:32

Hi,

We are aware of the inconsistent behaviour of the automatic charge calculation.
The automatic charge calculation should run only when the atom is placed on the canvas such a way that a charge is needed to fix it's valence. After a bond is attached to the atom the charge of the atom is not calculated any more. This can lead to the situation where there are two same structures with different behaviour.
Currently we are making developments to our valence check algorithm and we will take your request in account.
We will inform you when this feature is available.

Until then the automatic charge calculation can be turned off from API calling the atom.setFlags(atom.getFlags() | MolAtom.FIX_CHARGE) for each atom.

Best regards

Peter

ChemAxon fc046975bc

24-08-2012 07:16:36

Hi,


We implemented a new valence check that does not calculate and set charge.  It will be available in version 5.11.


Best Regards,


Peter

User 62a37f4796

08-05-2013 20:15:13










pszakacs wrote:

Hi,


We implemented a new valence check that does not calculate and set charge.  It will be available in version 5.11.


Best Regards,


Peter



Would you please point me to the documentation for this feature?


I think it might be https://www.chemaxon.com/marvin/help/developer/sketchman.html#parameters.valenceCheckEnabled but I'm not sure.


I'm still having trouble with valence checks upon changing the charge on heteroatoms with implicit H atoms.


Thanks.

ChemAxon fc046975bc

10-05-2013 07:16:47

Hi,


We have a documentation page here:
http://www.chemaxon.com/marvin/help/sci/ValenceCalculator.html


I hope it helps you!


Peter

User 62a37f4796

14-05-2013 18:40:37










pszakacs wrote:

Hi,


We have a documentation page here:
http://www.chemaxon.com/marvin/help/sci/ValenceCalculator.html


I hope it helps you!


Peter



Hi Peter,


The page you reference doesn't actually describe the JavaScript controls for this option that was rolled out in 5.11.


From the 5.12 documentation at http://www.chemaxon.com/marvin/help/developer/sketchman.html it is not clear to me what I would need to set or what value it should have.


I want to be able to check valence so that implicit H atoms are always correctly shown, but I don't want valence errors to be thrown or charges to be set automatically.


I'm dealing with students so I don't want to give them too much information, but of the things I will allow they should work correctly. Right now I'm running into situations where the number of implicit hydrogen atoms does not get automatically adjusted. For instance, if a student draws an alcohol with an explicit H, then deletes the H, an implicit H is not automatically added. Depending on how students draw answers they will have a different experience (and at the moment a different grade) even though they will have understood the chemistry correctly.


student 1: draw all C atoms for all atoms in 2-propanol; use the atom tools to change atom types; somehow figure out that they are not supposed to draw H atom; delete all H atoms => no implicit H on O


student 2: put all of the correct atom types on the canvas first using the atom tool; connect all the atoms using the bond tool => correct 1 implicit H on O


My best guess is that valenceCheckEnabled should be true, but what about the calculated charges? (nitromethane should not get automatic charges, for instance)


What do you make of it?

ChemAxon fc046975bc

15-05-2013 07:02:57

Hi,


Unfortunately I can't reproduce what you wrote. On my machine, in both cases implicit Hs set correctly. Since 5.11, the valence check does not set charges. Nitromethane appears for me without charge.


 


To hide valence error, and show implicit H on all atoms use this:


<html>

<body>

<p>Custom Applet</p>

<script type="text/javascript" src="./marvin/marvin.js"></script>

<script type="text/javascript">

msketch_begin("./marvin",800,600);
msketch_param("valenceCheckEnabled", "true");

msketch_param("valenceErrorVisible", "false");

msketch_param("implicitH", "all");

msketch_end();

</script>

</body>

</html>


Can you please write what parameters are set when you found, that valence check added charge to a molecule, and write step by step how you draw the structure?


Best Regards,


Peter