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

Fix inconsistencies with scoring ties in networkx #74

Open
bannanc opened this issue Feb 22, 2019 · 2 comments
Open

Fix inconsistencies with scoring ties in networkx #74

bannanc opened this issue Feb 22, 2019 · 2 comments
Labels
long term Caitlin did not have time to address

Comments

@bannanc
Copy link
Member

bannanc commented Feb 22, 2019

This is a list of my planned fix for the problem in PR #68. First, It appears that the test that is failing does in fact have a more complex set of molecules so it makes a little more sense why one is failing. Essentially what this comes down to though is what happens when there is a tie in the scoring function in the find_pair function in the cluster_graph code. I had written SMIRKS based on my understanding where that function would pair atoms to storage places in the order they were given when there were ties. The problem in PR #68 appears to be that in 3.5 this was the case, but there was a change in networkx that leads to the ties being treated slightly differently.

Ultimately this shouldn't be behavior that depends on networkx. I think it would be preferable if the score was updated based on neighboring atoms when there is a tie on the current atoms...

I'm still thinking about how to generalize this, what if you really have two identical molecules or very symmetric molecules where there is a REAL tie in the score? I will add more detail about how I found the problem in a little bit, but I wanted to do an initial brain dump.

@janash I'm getting closer to narrowing down the issue.

@bannanc
Copy link
Member Author

bannanc commented Apr 1, 2019

I need to add more details about how this causes issues in the overlaying of fragments, but as a temporary fix, I'm going to remove the problematic test because it asks to overlay bonds that are REALLY different so its not a very practical test.

The problematic test is this one:

    # 9
    (make_cluster_graph(['C1CCCC1', 'C1=CNC=C1', 'CO'], layers=2),
     "[#6H1X3x2r5+0a,#6H2X4x2r5+0A,#8H1X2x0!r+0A:1](-;!@[#1H0X1x0!r+0A])-,:[#6H1X3x2r5+0a," \
     "#6H2X4x2r5+0A,#6H3X4x0!r+0A:2](-,:[#1H0X1x0!r+0A,#6H2X4x2r5+0A,#7H1X3x2r5+0a])-;!@[#1H0X1x0!r+0A]",
     "[#6H1X3r5x2a,#6H2X4r5x2A,#8!rH1X2x0A;+0:1](-;!@[#1H0X1x0!r+0A])-,:[#6!rH3X4x0A," \
     "#6H1X3r5x2a,#6H2X4r5x2A;+0:2](-,:[#1!rH0X1x0A,#6H2X4r5x2A,#7H1X3r5x2a;+0])-;!@[#1H0X1x0!r+0A]"
     ),

Which attempts to overlay the

  • one of the C-C bond in cyclopentane
  • one of the C=C bonds next to the N in pyrrole
  • the C-O bond in methanol

I am going to put in a PR removing this test, switching to python3.6 and addressing issue #75

@bannanc
Copy link
Member Author

bannanc commented Jul 2, 2019

I removed the one problematic test in PR #68, but otherwise this is a longer term issue for someone to consider.

@bannanc bannanc added the long term Caitlin did not have time to address label Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
long term Caitlin did not have time to address
Projects
None yet
Development

No branches or pull requests

1 participant