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

Solvent masking is off when SFcalculator is not provided with an experimental dataset #1

Open
alisiafadini opened this issue Jun 29, 2023 · 1 comment

Comments

@alisiafadini
Copy link

I think the solvent masking is not estimated correctly if only a PDB file is provided (i.e. no experimental data) to SFcalculator.
This is observable in the real space electron density (e.g if loaded in Coot).

I believe the issue is that the scales are not initialized to good enough values when data is not provided.

In _set_scales, currently:

kiso=1.0,
kmask=0.35,
uaniso=[0.01, 0.01, 0.01, 1e-4, 1e-4, 1e-4]

But at the very least kmask should be resolution dependent with some average values. The following seems to work well and gives good real space density for a few test cases:

        kiso=1.0,
        kmask=0.00,
        uaniso=[1e-4, 1e-4, 1e-4, 1e-4, 1e-4, 1e-4]

with added resolution dependence

       self.kmasks = []

        for bin_i in np.sort(np.unique(self.bins)):
            index_i = self.bins == bin_i
            s_squared = 1 / np.mean(self.dHasu[index_i])
            kmask = 0.85 * np.exp(-250 * s_squared / 4)
            kmask_tensor = (
                torch.tensor(kmask).to(self.atom_pos_frac).requires_grad_(requires_grad)
            )
            self.kmasks.append(kmask_tensor)

I use the kmask expression:
kmask = ksol * exp( -Bsol * s**2 /4) with ksol = 0.85 (midway between 0.75-0.95)
and Bsol = 250 (midway between 150-350) from Glykos & Kokkinidis, Acta Crystallogr D Biol Crystallogr. 2000 Aug;56(Pt 8):1070-2

These are probably not the most representative values, but they seem to do the trick. Thoughts?

@minhuanli
Copy link
Member

Sorry for the late reply. Before we were thinking the solvent mask is used as a modeling for better fitting the experimental observables, so it was not clear about how to apply a solvent mask without experiments.

But the values you provided all make sense. Also I feel this could be used to implement a new method to generate synthetic crystallography observables when only PDB is provided. I am working on the implementation and will create a PR in the torch version. Thanks for the suggestions!

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