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

Using setMolecule with molfile does not rescale bond lengths #3017

Closed
mliu49 opened this issue Aug 1, 2023 · 3 comments · Fixed by #4110 or #4112
Closed

Using setMolecule with molfile does not rescale bond lengths #3017

mliu49 opened this issue Aug 1, 2023 · 3 comments · Fixed by #4110 or #4112

Comments

@mliu49
Copy link

mliu49 commented Aug 1, 2023

Steps to Reproduce


     RDKit          2D

  6  6  0  0  0  0  0  0  0  0999 V2000
    1.5000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7500   -1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7500   -1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.5000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7500    1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7500    1.2990    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0
  2  3  1  0
  3  4  2  0
  4  5  1  0
  5  6  2  0
  6  1  1  0
M  END
  1. Using ketcher standalone, import the molfile above using ketcher.setMolecule
  2. Import it again but using the Open... > Paste from clipboard option

Actual behavior
The two benzene rings are different sizes.

Expected behavior
I would expect setMolecule to scale the bond length in the same way as the Open... menu.

Screenshots
In the image below, first benzene was added with setMolecule, second benzene was added via Open... menu button, third benzene was drawn with benzene button.
image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome

Ketcher version [e.g. v2.4.2].
Tested in v2.6 and v2.11

@mliu49 mliu49 added the bug label Aug 1, 2023
@mliu49
Copy link
Author

mliu49 commented Sep 13, 2023

Hi, could you confirm whether this is a bug or if there's a workaround? We just want to be able to set a molfile programmatically and have the drawing be re-scaled. Thanks!

@rrodionov91 rrodionov91 added this to the Ketcher 2.19.0-rc.1 milestone Jan 31, 2024
@rrodionov91
Copy link
Collaborator

Hi @mliu49,
Thank you for raising this issue.
We reproduced it and planned to v2.19.

@AlexeyGirin AlexeyGirin assigned rrodionov91 and unassigned Nitvex Feb 8, 2024
rrodionov91 added a commit that referenced this issue Feb 19, 2024
- added molecules scaling in setMolecule and addFragment api methods.
@rrodionov91 rrodionov91 linked a pull request Feb 19, 2024 that will close this issue
9 tasks
rrodionov91 added a commit that referenced this issue Feb 20, 2024
…4110)

- added molecules scaling in setMolecule and addFragment api methods.

---------

Co-authored-by: Roman Rodionov <[email protected]>
rrodionov91 added a commit that referenced this issue Feb 20, 2024
- added molecules scaling in setMolecule and addFragment api methods.
rrodionov91 added a commit that referenced this issue Feb 21, 2024
…nd lengths (#4112)

- added molecules scaling in setMolecule and addFragment api methods.
@Zhirnoff
Copy link
Collaborator

Tested. Fixed.
2024-03-11_17h46_26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment