Skip to content

Conversation

n-yoshikawa
Copy link
Contributor

This pull request is my update to #1738.

@ghutchis
Copy link
Member

ghutchis commented Mar 2, 2019

I can't remember - did we merge this in separately? Certainly many of your fixes were needed in the DG code.

@n-yoshikawa
Copy link
Contributor Author

If I.remember correctly, this PR is just for notifying my progress to others and still have a lot of problems. We should not merge.

@n-yoshikawa
Copy link
Contributor Author

n-yoshikawa commented Jun 18, 2019

update:

  • Use random distance matrix for initialization
  • Optimize coordinates in 4D
  • Use BFGS implemented in CppOptimizationLibrary LBFGS++
  • Introduce new error function instead of swapping atoms

I want to discuss where to put cppoptlib directory.

@ghutchis ghutchis mentioned this pull request Sep 3, 2019
@ghutchis
Copy link
Member

ghutchis commented Sep 3, 2019

@n-yoshikawa - is this ready for review?

@n-yoshikawa
Copy link
Contributor Author

Yes, it's ready. I put BFGS library at include/openbabel/LBFGS.h for now, but I'm not sure this is the correct directory.

@ghutchis
Copy link
Member

ghutchis commented Sep 3, 2019

This looks good - can we move the LBFGS outside of include/openbabel - it's not really our header and I don't want to imply that.

If you can change the #include lines, I think this is good to merge - even if you implement a better DG method.

@n-yoshikawa
Copy link
Contributor Author

I moved the LBFGS.h to include/. Is this ok?

Also, I found an issue on treatment of chiral center which may cause segmentation fault, so I want to debug it before merge.

@n-yoshikawa
Copy link
Contributor Author

I solved the chiral center problem, but some of tests failed.

This is possibly because convergence check by OBDistanceGeometry::CheckStereoConstraints() does not always agree with the check by canonical SMILES.
Convergence check is another serious problem on coordinate generation, which is discussed before: https://sourceforge.net/p/openbabel/mailman/message/36699127/.

I will try canonical SMILES based convergence check and see how it works.

@ghutchis
Copy link
Member

ghutchis commented Sep 4, 2019

I don't think you need a canonical SMILES. As long as the atoms aren't re-ordered, I don't think the SMILES should change order, right?

But I'd like to get a list of some cases where the DG declares success but the canonical SMILES is wrong (i.e., before any MMFF cleanup, etc.) - let's see why the stereo constraints claims to be correct and the SMILES is wrong. That seems like a bug.

@n-yoshikawa
Copy link
Contributor Author

I intended to use canonical SMILES for checking input and predicted chirality as the latest commit. It worked in my local environment, but it didn't in Travis CI. I'm investigating why.

I will prepare some cases where the judgement of DG and canonical SMILES does not match.

@ghutchis
Copy link
Member

I'd like to merge this, but I'm not sure what to do about the test failures.. Any ideas?

@n-yoshikawa
Copy link
Contributor Author

The test failure is supposed to be caused by the difference between SMILES generate from the predicted molecule (

std::string predicted_smiles = conv.WriteString(&_mol, true);
) and SMILES generated from SDF made by obabel. I'm not sure why such a difference exists.

@baoilleach
Copy link
Member

The difference may be caused by the fact that you are branching off an old version of master. I would rebase on master if I were you, check for the failure, and then force push to this branch. Note that it is a very good idea to make a copy of your local git repo before doing this in case you need to revert.

@n-yoshikawa
Copy link
Contributor Author

I tried rebase, but the test still failed.

@baoilleach
Copy link
Member

I'll take a look.

@n-yoshikawa
Copy link
Contributor Author

I misunderstood the meaning of SetChiralityPerceived(). I intended to set chirality based on the current 3D structure instead of cached one, but it was opposite. I replaced it to StereoFrom3D(), but the test still fails. Maybe SMILES generation is not dependent on these settings?

In addition to distance geometry related test failures, there are many tests failing. I'm not sure rebase was successful. Closing this pull request and branching from the current master may make problem easier.

StereoFrom3D(&_mol, true);

@e-kwsm
Copy link
Contributor

e-kwsm commented Nov 19, 2019

Closing this pull request and branching from the current master may make problem easier.

There is no need to close this PR: git checkout -B to reset the branch after backup, and force push. Also, git bisect is useful to find the bug—I tried locally but it says 41c8367 is the first bad commit; perhaps 936db37 or c11a198 is.

# A series of aromatic strings, which should convert to themselves
self.smiles = [
'c1ccccc1', # benzene
'C/C=C\C', # Z-butene
Copy link
Contributor

Choose a reason for hiding this comment

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

r'C/C=C\C' or 'C/C=C\\C'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thank you for your comment.

@@ -275,7 +269,7 @@ endif (PYTHON_BINDINGS)
function(add_depict_test testname obfile image_file ref_image)
set(depict_dir ${CMAKE_BINARY_DIR}/depict_test)
add_test(NAME test_${testname} COMMAND ${CMAKE_SOURCE_DIR}/test/test_depiction.sh
${CMAKE_BINARY_DIR}/bin/obabel ${ImageMagick_convert_EXECUTABLE}
${CMAKE_BINARY_DIR}/bin/babel ${ImageMagick_convert_EXECUTABLE}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be modified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. This file should be fixed.

@ghutchis
Copy link
Member

@n-yoshikawa - you read my mind- last night I was thinking 'let's just have easier tests for now and work on improving'

@ghutchis ghutchis merged commit c251724 into openbabel:master Nov 22, 2019
@n-yoshikawa
Copy link
Contributor Author

I made the test case easier to pass the test for now. I think it is allowed as distance geometry is described as "unstable" in the document

I want to improve distance geometry anyway and I want to have advice about how to implement CheckStereoConstraints(). I'm currently comparing input SMILES and output SMILES, but it does not seem to be working...

@n-yoshikawa n-yoshikawa deleted the distance-geometry branch November 22, 2019 18:56
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.

4 participants