Merge pull request #5024 from RosettaCommons/JackMaguire/HYP
Adding hydroxyproline to packer palette.
This is some good ole fashion test driven development. I'm adding one line that breaks a test for @vmullig and @everyday847 to fix.
The test I'm breaking is the ability for Rosetta to load hydroxyproline into a PackerPalette.
----------------
From @vmullig:
So this was a bit more involved than I had anticipated. The status quo in Rosetta was that hydroxyproline was a patched version of proline, with name "PRO:pro_hydroxylated_case1", 3-letter code "HYP", and 1-letter code "P". We wanted to be able to specify "HYP" (and "DHYP") in a PackerPalette, but this would require that the base name is "HYP" -- the CustomBaseTypePackerPalette matches on base name, not on three-letter code. We don't currently have the ability for patches other than the chirality-inverting patches to change the base name, and the chirality-inverting patches create a new base type when they do so -- we have some hard-coded stuff that requires on-the-fly patched types to retain the same base name, and which assumes that all unique base names are represented in the set of base residue types that are created at Rosetta initialization. It is convenient to create hydroxyproline by patching proline (ensuring that we're copying the proline geometry and properties and whatnot), but inconvenient to expect the user to know that that is what we're doing internally -- he/she should be able to work with HYP, not PRO:pro_hydroxylated_case1, and to have the full freedom of manipulating an independent residue type, not a type variant. So ultimately, the only feasible solution was:
- To generalize the logic for special patches that create new base types.
- To modify the pro_hydroxylated_case1 and pro_hydroxylated_case2 patches so that they both create new base types.
- To modify the PackerPalette so that it does not attempt to match on the hydroxyproline-specific variant types when setting up lists of designable types.
This works now, and I've confirmed that we can design with HYP sand DHYP simply by adding them in the list of allowed types in a CustomBaseTypePackerPalette. It also should be relatively easy to apply this to the small number of other special cases in which we would want a patch to create a new base type.