Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/qsarmol nomod #407

Merged
merged 4 commits into from Jan 14, 2018
Merged

Patch/qsarmol nomod #407

merged 4 commits into from Jan 14, 2018

Conversation

johnmay
Copy link
Member

@johnmay johnmay commented Jan 3, 2018

I don't like this but it fits with the current design. Note that if you don't assign atom types to the benzene i used in the test... then aromaticity won't get added and it looks okay. As shown here it's not really okay. I would argue this is inconsistent - there require atom types must be set before being called.

Also interesting that the AcidicGroupCount vs BasicGroupCount - one has an aromaticity option the other does not.

Copy link
Member

@egonw egonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Note the comments.

@@ -115,7 +114,7 @@ public IMonomer getMonomer(String cName) {
/**
* Returns a collection of the names of all <code>Monomer</code>s in this
* polymer.
*
*f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

@@ -64,7 +63,7 @@
*/
public Polymer() {
super();
monomers = new Hashtable<String, IMonomer>();
monomers = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new Java magic, right? It takes the typing automatically from the type of the 'monomers' variable definition, correct? (I guess a rhetorical question :)

@@ -114,6 +114,8 @@ public DescriptorValue calculate(IAtomContainer atomContainer) {
throw new IllegalStateException("descriptor is not initalised, invoke 'initalise' first");
}

atomContainer = clone(atomContainer); // don't mod original
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, very much agreed, this is not how it should be. In the past I have changed code to not have to do this. But as a workaround this will do for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(But that explains why you will find that flag copying and restoring code around :)

}

@Test
public void descriptorDoesNotChangeFlags() throws CDKException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, thanks!

@egonw
Copy link
Member

egonw commented Jan 14, 2018

@johnmay, I guess you will want to fix the one type, but that's the only thing I suggest to change.

@johnmay
Copy link
Member Author

johnmay commented Jan 14, 2018

done

@k-ujihara
Copy link
Contributor

I propose an idea.

  1. To IAtomContainer, add a flag indicating configured or not.
  2. If the flag is true, qsarmol does not touch the molecule before calculation.
  3. Otherwise it does same as current implementation.

I consider it does not break existing codes and may improve performance when we need various properties of one molecule.

@johnmay
Copy link
Member Author

johnmay commented Jan 16, 2018

Possible, in general this is similar to what RDKit and I think Open Babel does, I know that Noel for example would like to remove it. For example they have flags like 'hasRingPerception' done, this extra book keeping is problematic and less flexible. However in a reduced form just for the QSAR it could be useful. I would however set the flag/option on the descriptors.

Like the ones that allow/skip aromaticity perception. Then in the engine you can set this globally such that it's configured once and then never agin.

John

@johnmay johnmay deleted the patch/qsarmol_nomod branch March 18, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants