Merge pull request #926 from RosettaCommons/vmullig/improve_aacomp
Add user-requested improvements to aa_composition score term
As listed in issue #901, users have requested a number of new features to make the aa_composition score term useful for _de novo_ protein design. This pull request begins to implement some of these.
Tasks:
- [x] Unify the PENALTY_DEFINITION groups. Rather than having separate code for counting amino acid types or amino acids with certain properties, let all of these be defined together.
- Details: I won't implement full Boolean logic at this point, since it's hard to do. Instead, residues will be counted in a given group if: (any TYPE matches) OR (((all PROPERTIES match) OR (any OR_PROPERTIES) OR (no TYPEs defined and no PROPERTIES defined AND no OR_PROPERTIES defined)) AND (no NOT_PROPERTIES match) AND (no NOT_TYPE matches))
- [x] Move AACompositionEnergy class to a new namespace, in which helper classes can be created.
- [x] Update unit tests to reflect new namespace.
- [x] Modify the AACompositionPropertiesSet class to store both types and properties.
- [x] Modify the AACompositionPropertiesSet class for the Boolean logic, above.
- [x] Add unit tests for the more complicated Boolean logic.
- [x] Update documentation for this.
- [x] Add clone() functionality to ResidueSelectors.
- [x] Add an AACompositionConstraint for constraining sequences, analogous to geometric constraints.
- [x] Store a selector in the object.
- [x] Store a AACompositionEnergySetup object in the object.
- [x] Have it initialize the AACompositionEnergySetup object from an input .comp file.
- [x] Functions to hand off the AACompositionEnergySetup object to the score term at scoring time.
- [x] Add a SequenceConstraint base class for the AACompositionConstraint.
- [x] Modify the ConstraintSet container to accept SequenceConstraints.
- [x] Add a mover to add sequence constraints that takes a .comp file and an optional ResidueSelector.
- [x] Strip out extraneous stuff.
- [x] parse_my_tag() should let the user set an input comp file and a selector.
- [x] Create an AACompositionConstraint at parse time; clone it and add it to the pose at apply time.
- [x] Documentation for this.
- [x] Add a mover to clear sequence constraints.
- [x] apply() function
- [x] Documentation for this.
- [x] Set the aa_composition score method to score using one or more global .comp files (if defined -- e.g. by the user, using a flag) AND one or more scorefunction-specific .comp files (if defined -- e.g. by the user, in RosettaScripts), AND .comp files attached to constraints stored in the pose (if defined -- e.g. by the user, in RosettaScripts). These last can be filtered by ResidueSelectors to allow the user to score sub-regions of a pose.
- [x] AACompositionEnergy should store a vector of AACompositionEnergySetup objects: one from global settings and many from scorefunction setup (e.g. in RosettaScripts).
- [x] Add a setup_residuearrayannealableenergy_for_packing() virtual function (that does nothing by default but which can be implemented by derived classes) to the ResidueArrayAnnealableEnergy that's the parent class for the AACompositionEnergy.
- [x] At score time, the score term can construct a vector of AACompositionEnergySetup objects and a vector of ResidueSubset masks that it will use for scoring. These can be taken from its internally-stored vector and from the pose. Add a version of the calculate_energy() function that takes these two vectors.
- [x] Have the finalize_total_energy() function generate the vectors and call the modified calculate_energy() function directly (for scoring).
- [x] Implement a setup_residuearrayannealableenergy_for_packing() function that will create the vector of AACompositionEnergySetup objects, stored temporarily in the AACompositionEnergy object, and the vector of ResidueSubset masks.
- [x] Have the default calculate_energy() function call the modified calculate_energy() function, passing it the cached vectors (for packing).
- [x] Integration test for this (that also tests the above two movers).
- [x] Documentation for this.
- [x] Fix whitespace issue identified by Zibo.
- [x] Look at bug identified by Peilong.
- [x] Add the following properties to the PROPERTIES table and to params files:
- [x] ALIPHATIC
- [x] POSITIVE_CHARGE
- [x] NEGATIVE_CHARGE
The following tasks were grouped into pull request #928, which was merged before this pull request:
- Move residue selectors to core.4 from core.3 so that constraints can use them.
- I'm moving these out of core/pack (since they don't just control the packer) and into core/select/residue_selector/.
- Resolve compile issues.
- Resolve library levels problems.
- Resolve any unit test problems.