Open russell-taylor opened 2 years ago
If we make a command-line argument to leave some hydrogens, then we need to go back to the more-general approach for finding rotatable hydrogens, calling mmtbx.model.model.rotatable_hd_selection() in the outer structure as is done in commit e280c8e20be49698ee5cb84feb0a5227c42c00bc before we switched to our custom _getRotatableSingleHydrogens() method. We should do one or the other depending on the command-line argument -- when Hydrogenate is removing and placing all hyrogens then it will avoid placing them in bad location. As Dorothee points out: "If we allow the user to keep existing H atoms, then you may encounter any scenario. Hydrogenate won't check the input. It will either place new ones or keep the existing ones. I plan to allow a selection, i.e., keep H in one selection and (re)place them in the remaining part. You may want to double check when there is a "split" of alternates, f.ex. a SER with H and D on the oxygen, or a simple H with the rest of the residue split (such things occur in deposited files)."
Consider the case when someone with a neutron structure wants to put movers only where they don't know for sure if a hydrogen is located somewhere (not seen in the density). The ones they see in the density should not get moved. Some sort of Boolean flags telling per-residue whether to add a Mover. Not so -- ligands and carbohydrates can have more than one Mover. Maybe a Boolean per Hydrogen (or per atom) telling whether it can move. Any potential Mover that contains an atom marked unmovable cannot be a Mover.