Skip to content

Guide: how to add new scoring functions

Nathan Mih edited this page May 11, 2019 · 2 revisions

Make the new Feature class

  1. Create a new feature class containing the method to calculate your feature in dtailor/Features/Basic.py, or make a new module if you'd like
  2. The class must have the method set_scores that sets the calculated feature in self.scores
  3. You can also manually set self.mutable_region to be in the location of this specific feature, in order to target mutagenesis to the region. The LocalGC class is a good example of how to do this.

Add the feature to GenericDesigner and incorporate this feature into tests

  1. In dtailor/RunningExamples/Designer/GenericDesigner.py, add your feature to the configureSolution method
  2. In dtailor/test/conftest.py...
    • Add the levels for your feature (example: _levels_smallrepeats = {'1': (0, 40), '0': (40, 100)})
    • Make a new fixture for these levels
    • Add the feature to design_params
    • Since this feature is in an OrderedDict, add it to the _targets variable at the end according to the level you want it to reach
  3. In dtailor/test/test_doe_design.py add to the two methods, adjust the n_features
  4. Run the tests to make sure your new feature works