project-gemmi / gemmi

macromolecular crystallography library and utilities
https://project-gemmi.github.io/
Mozilla Public License 2.0
212 stars 44 forks source link

Feature request: Gemmi alternative to 'NOISE' option of PDBSET #326

Closed drlemmus closed 4 days ago

drlemmus commented 1 month ago

I'm currently using the NOISE function in PDBSET to perturb the atomic coordinates in a structure model and I'm looking for an mmCIF way to do that (without scripting that in Python). Could you add such an option in the command-line gemmi?

wojdyr commented 1 month ago

The noise distribution is uniform rather than normal?

I can add it quickly. But I'm thinking where to put it. So far I've been cramming everything into the convert subcommand. I have other things from PDBSET there: BFACTOR and transforming/shifting. Perhaps they should be in a separate subcommand. If that subcommand is only modifying properties of atoms, all the rest of the file could be kept intact.

I'll look into it when I finish what I'm doing now, in about a week.

drlemmus commented 1 month ago

I had a a look at the descriptions of the RANMAR algorithm. It seems to be uniform, I guess that is why it can also be used in Freeflag. Perhaps that is why PDBSET has a cap on the amplitude, it becomes too unrealistic if you set the amplitude too high, but with small amplitudes the distribution doesn't matter. Sinsce adding noise is not associated with format conversion indeed a separate subcommand would be sensible.

wojdyr commented 4 days ago

documentation: https://gemmi.readthedocs.io/en/latest/utils.html#set