Open donkirkby opened 6 years ago
The AST could be crawled recursively to accumulate the mutations
in DrmExpr
nodes:
def crawl(term):
if hasattr(term, 'mutations'):
return term.mutations
elif issubclass(type(term), DrmExpr):
return [crawl(m) for m in term.children]
This could be a method of the DRMParser
class.
The returned list would have to be flattened and cleaned of Nones returned by non-mutation terminal nodes. With a stricter class hierarchy that's rooted in the common drm module this could be cleaned up.
Since we added rules for scoring the resistance to HIV and HCV drugs, we could use the mutation positions to choose key positions when giving a coverage score. Presumably, we should continue to allow key positions as part of the project definitions for regions that don't have resistance rules.
Somewhat related to the tool for editing project definitions described in #425.