mojaie / MolecularGraph.jl

Graph-based molecule modeling toolkit for cheminformatics
MIT License
197 stars 29 forks source link

Add substructure 1:1 node matching #45

Closed timholy closed 3 years ago

timholy commented 3 years ago

When you want to preserve some property indexed to the nodes, it's helpful to construct the node map.

I wasn't sure if this functionality already existed by other means. For my application, the nodeset approach in https://github.com/mojaie/MolecularGraph.jl/issues/39#issuecomment-734317445 is not sufficient because I want to be able to map the specific atoms between the structures. Specifically, I want to do 3d alignment to a steroid backbone, and so I want to know how to map the standard steroid carbon numbering system between two structures.

~This currently fails because it seems there's some overly-permissive SMARTS matching, so even if this functionality exists and I just missed it, at least the test should be useful.~ Nevermind, I missed the need to supply nodematcher!

codecov-io commented 3 years ago

Codecov Report

Merging #45 (01cf7dd) into master (8844432) will increase coverage by 0.10%. The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
+ Coverage   75.24%   75.34%   +0.10%     
==========================================
  Files          53       53              
  Lines        4189     4206      +17     
==========================================
+ Hits         3152     3169      +17     
  Misses       1037     1037              
Impacted Files Coverage Δ
src/graph/isomorphism/vf2.jl 85.03% <ø> (ø)
src/substructure.jl 80.39% <94.11%> (+1.71%) :arrow_up:
src/smarts/base.jl 76.92% <0.00%> (+2.56%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8844432...01cf7dd. Read the comment docs.