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

Avogadro struggles to fill a unit cell with molecular structures #1611

Open
nbehrnd opened this issue Feb 9, 2024 · 3 comments
Open

Avogadro struggles to fill a unit cell with molecular structures #1611

nbehrnd opened this issue Feb 9, 2024 · 3 comments

Comments

@nbehrnd
Copy link
Contributor

nbehrnd commented Feb 9, 2024

Avogadro version:

  • Avogadrolibs: 1.98.1 in the nightly built AppImage for Linux, packaged 2024-02-08 22:14, md5sum is d6b0578d68f58a067ff0de74362b2aee Avogadro2.AppImage.zip
  • Qt: 5.15.2

Desktop version:

  • OS: Linux Debian 13/trixie, branch testing

Describe the bug

A structure model read by Avogadro as .cif file about a molecular compound initially displays well with atoms connected by reasonable bonds. Once one aims for a depiction which fills the unit cell, the original molecule is oddly truncated, and the new molecule(s) is/are displayed partially, with isolated atoms only.

Because this does not happen to models of inorganic structures (e.g., sodium chloride), I speculate bonds assigned while initially reading the .cif file might contribute to the issue.

To Reproduce

Observed with .cif files 4039026.cif by the crystallographic open database (COD)

  1. as display types, ensure Crystal Lattice, Ball and Stick are activated
  2. read either of the files by Ctrl + O / File -> Open
  3. to complete the cell, Crystal -> Space Group -> Fill Unit Cell
  4. See error

Expected behavior

The preferred result would i) retain the molecule initially displayed complete, ii) apply the symmetry operators in the .cif reports, iii) display fully the then generated new molecules whose centroids fit into the unit cell. This is the default for instance in CCDC's Mercury visualizer (other options available there are e.g., to display molecules with any or all atoms in the unit cell; but each option has pros and cons)

Screenshots

deformed_model

Additional context

2024-02-09_model_report.zip

Copy link

welcome bot commented Feb 9, 2024

Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/

@ghutchis ghutchis transferred this issue from OpenChemistry/avogadroapp Feb 10, 2024
@ghutchis
Copy link
Member

ghutchis commented Mar 3, 2024

The "trick" is that it's keeping bonds even when they should span the unit cell boundaries.

I think the behavior of CCDC Mercury is to "fill" the unit cell, but include atoms that span the boundary if they're part of the same molecule, correct?

@ghutchis
Copy link
Member

When you have a chance, could you check the latest nightly build? I made some progress towards this - the recent #1898 will now only "wrap" new atoms when filling the unit cell, which should preserve the existing atom and bonds.

Screenshot 2024-12-28 at 10 30 31 AM

It will take some time to work through better heuristics like CCDC Mercury.

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

No branches or pull requests

2 participants