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

Small molecule tutorial should use dials.export format=shelx #2608

Open
2 tasks
dagewa opened this issue Feb 12, 2024 · 10 comments
Open
2 tasks

Small molecule tutorial should use dials.export format=shelx #2608

dagewa opened this issue Feb 12, 2024 · 10 comments

Comments

@dagewa
Copy link
Member

dagewa commented Feb 12, 2024

The small molecule processing tutorial describes export to .hkl by going via MTZ then running

xia2.to_shelx scaled.mtz lcys CHNOS

This should not be necessary now because we have dials.export format=shelx

TODO

  • Check the tutorial works with dials.export format=shelx
  • If so, update the text

Another problem with the tutorial is that it does not explain that dials.symmetry may not suggest the correct space group if there are mirrors and glides, and as a result the dials.scale job may not be using all the symmetry that it could.

@huwjenkins
Copy link
Contributor

This was discussed last year. One comment is that, unlike xia2.to_shelx, format=shelx writes an .ins file that only contains information known to dials.export i.e. the space group, unit cell parameters and their esds.

Is adding an option to add information about the composition of the crystal desired? FWIW for solution by SHELXT I add:

SFAC C H etc etc
UNIT 0
HKLF 4
END

For SHELXD the UNIT line has to be correct which also means the space group must be too. For SHELXT only the Laue group matters and I almost never actually run dials.scale in the correct (usually non-MX) space group.

@dagewa
Copy link
Member Author

dagewa commented Feb 23, 2024

Good point. I think it would be useful to optionally add a composition. I usually use edtools.make_shelx for this (as all my small molecule work is 3D ED) but as I have discovered the electron scattering SFAC lines apparently hardly matter for structure solution with shelxt. So in that case just setting minimal things like your example, and then updating the instructions in e.g. Olex2 would do.

@huwjenkins
Copy link
Contributor

huwjenkins commented Feb 23, 2024

as I have discovered the electron scattering SFAC lines apparently hardly matter for structure solution with shelxt.

I tested this a while ago but repeated just now. For one of our structures using the following SFAC in the ins file:

SFAC C H B N O F P Mn
UNIT 0

vs

SFAC C 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC H 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC B 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC N 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC O 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC F 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC P 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
SFAC Mn 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 =
 0 0 0 0 1.000 1.000
UNIT 1 1 1 1 1 1 1 1

i.e. nonsensical scattering factors (malformed SFAC lines with incorrect number of parameters also work) with:

shelxt xxx -m500 -y -a -t1

(no multithreading to guarantee consistent output) results in the only difference between .res files is that the UNIT instruction is carried over (the scattering factors are not - so there's no advantage adding them before running SHELXT).

I believe this paper which states having the correct scattering factors for electron scattering is a "critical step" for structure solution with SHELXT is incorrect. The supplied scattering factors are ignored by the program which as described only reads the elements that are expected to be present from the .ins file.

Obviously for refinement the correct scattering factors do need to be added...

@huwjenkins
Copy link
Contributor

Also be aware that some of the electron scattering factors in source_sfac_electron in edtools are all 0 for some elements. These apparently came from SIR2014 which had X-ray scattering factors for some elements: https://github.com/instamatic-dev/edtools/blob/a7d40c4142d641b99b13782b396db432d551ced5/edtools/atomlib.yaml#L25

@dagewa
Copy link
Member Author

dagewa commented Feb 23, 2024

Hi Huw, very interesting, thanks! I would be happy to drop edtools.make_shelx and leave SFACs to refinement programs. But it would be convenient if dials.ins could go be used immediately by shelxt.

Olex2 appears to give a choice of three different SFAC for ED: Peng-1999, UCLA-2022 and CAP-2022. I have not looked into the differences. The options each have the text "4G" appended, which I assume to mean a 4-Gaussian model. I note also that shelxle can write ED SFAC lines, using the Peng data.

@huwjenkins
Copy link
Contributor

huwjenkins commented Feb 24, 2024

I note also that shelxle can write ED SFAC lines, using the Peng data.

🤣 when was that added? - I wrote a script to reformat the coefficients from the Peng 1999 paper as SFAC lines to copy-paste into ShelXle

EDIT just tried. This gives identical SFAC lines to my script which is interesting because of the source of atomic radii used.

@huwjenkins
Copy link
Contributor

I have done a bit of testing.

SHELXT works perfectly with the following input:

SFAC C H B N O F P Mn
UNIT 0

However an .ins file containing these lines cannot be read into Olex2 but can be read into ShelXle. An .ins file completely lacking the SFAC and UNIT instructions can be read into Olex2 but not ShelXle.

What a mess. I propose either writing an .ins file with:

SFAC C
UNIT 0

which should work for both GUIs. Or adding code based on that in xia2.to_shelx to add correct SFAC and UNIT cards if the user enters a full formula but only a list of elements if they don't (UNIT 0 0 0 0 etc). The code in xia2.to_shelx looks pretty robust to parsing a free-format user string apart from it can't handle a formula containing Xe and should probably check the elements are in the 94 that have scattering factors in SHELXL (H - Pu)

@dagewa
Copy link
Member Author

dagewa commented Feb 28, 2024

Thanks for the investigation Huw. I think adopting the approach in xia2.to_shelx when the composition is available makes sense. Shall I add that, or would you like to? I'm happy to, but I have a few other things to work on first.

@huwjenkins
Copy link
Contributor

I can do it - should this go into util/export_shelx.py as _parse_compound() or something or is there a better place to add it to DIALS?

@dagewa
Copy link
Member Author

dagewa commented Feb 28, 2024

Thanks! I would say there is no better place than export_shelx.py

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