Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
setElectronProp()
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
Bob

Joined: 15 Jun 2004
Posts: 2629

View user's profile

Back to top
Link to postPosted: Tue Sep 02, 2008 3:36 pmPost subject: setElectronProp() Reply with quote

Marvin 5.1 has a new MolAtom method, setElectronProp():

Code:
setElectronProp

public void setElectronProp(int eProp)
     Sets the number of lone pairs or radical state.
Parameters:
     eProp - the number of lone pairs or radical state to set.
See Also:
     ExtraAtomProperties.LP_NOT_SET, ExtraAtomProperties.RD_NOT_SET, ExtraAtomProperties.UNDEFINED


How does one designate whether setElectronProp() sets the number of lone pairs or the radical state? Or do you mean "and", and, if the value of eProp is odd, the radical state is set to monovalent, and if it is even, the radical state is set to off?

Also, the API also needs a MolAtom method for automatically setting the lone pair count to a number calculated by Marvin, and a Molecule method that does it for all atoms in the Molecule. Currently, the programmer has to calculate the lone pair count himself and set it for every individual atom. I know there’s already a method in Marvin for doing the calculation, because one can automatically display lone pairs in Marvin, but it doesn’t appear to be accessible from the API.
Erika
ChemAxon personnel
Joined: 12 Oct 2005
Posts: 293

View user's profile

Back to top
Link to postPosted: Wed Sep 03, 2008 3:00 pmPost subject: Reply with quote

Dear Bob,

setElectronProp()/getElectronProp() sets and gets some electron related information stored as extra atom property in MolAtom.

The meaning of possible values:
ExtraAtomProperties.RD_NOT_SET is used when radicals are not set to an exact value (that’s why it is a state and not count). For example in editing steps after choosing “Switch Radical” button there is a special atom in your hand where no exact radical value is set, the molecule joining step has to solve the problem and sets the number of radicals depending on the context.

ExtraAtomProperties.LP_NOT_SET is similar to ExtraAtomProperties.RD_NOT_SET for the special atom that is in your hand after pressing “Increase Lone Pairs” button: no exact lone pair value is set.

These values are related to a very special usage in Marvin during editing. What you probably need is setting the electron properties to a value between 0 and 4. This has the meaning that the atom has this number of lone pairs. For example: after calling setElectronProperty(3), 3 lone pairs will belong to the atom. We will add the missing information to the API documentation.
The number of radicals can be set / get with the MolAtom.setRadical() / getRadical() methods.

MoleculeGraph.getLonePairCount(int i) is already available for getting the automatically calculated lone pair count of an atom (this is called when Marvin displays the automatically calculated lone pairs). Then the calculated lone pair value can be stored in MolAtom by MolAtom.setElectronProperty().

I hope this helps, let me know if you need more information.

Best Regards,
Erika.
Bob

Joined: 15 Jun 2004
Posts: 2629

View user's profile

Back to top
Link to postPosted: Wed Sep 03, 2008 6:12 pmPost subject: Reply with quote

It helps a great deal. I wasn't looking in MoleculeGraph() for the method that calculates the number of unshared electrons on an atom. May I suggest you add a method to MolAtom() that calls the MoleculeGraph() method? It can throw an error or return a negative value if the MolAtom is not part of a MoleculeGraph.

Again, I suggest you consider merging lone pairs and radicals into a single value, unshared electrons, in future versions of Marvin. You can retain the radical flag, but it would be mutually interdependent with the number of unshared electrons.
Erika
ChemAxon personnel
Joined: 12 Oct 2005
Posts: 293

View user's profile

Back to top
Link to postPosted: Fri Sep 05, 2008 1:31 pmPost subject: Reply with quote

Dear Bob,

Thank you for your suggestions. Handling lone pairs and radicals in a single value is not possible at the moment, because the recent implementation was an extension of the already existing radical /lone pair representation. We will consider your request before refactoring some parts of the code.

Would you like a method that returns the same value as MoleculeGraph().getLonePairCount(int i) or the number of unshared electrons (lone pairs + radicals)?

Best Regards,
Erika.
Bob

Joined: 15 Jun 2004
Posts: 2629

View user's profile

Back to top
Link to postPosted: Fri Sep 05, 2008 1:38 pmPost subject: Reply with quote

I think it is best to be consistent, so have MolAtom.getLonePairCount(). I can always compute the number of unshared electrons from the lone pair count and the radical state.
Erika
ChemAxon personnel
Joined: 12 Oct 2005
Posts: 293

View user's profile

Back to top
Link to postPosted: Mon Sep 08, 2008 11:04 amPost subject: Reply with quote

Dear Bob,

Thank you for your suggestion. We will add this method.
We will notify you as soon as the implementation is out.

Best regards,
Erika.
Erika
ChemAxon personnel
Joined: 12 Oct 2005
Posts: 293

View user's profile

Back to top
Link to postPosted: Mon Jan 12, 2009 10:58 amPost subject: Reply with quote

Dear Bob,
The new MolAtom.getLonePairCount() method is going to be ready in Marvin 5.1.5.
Best regards,
Erika.
This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum