rule_classes.RuleSet
rule_classes.RuleSet(self, rules=[], rule_path=None)
A rule set class
Pass RuleSet
either a rules dictionary, or a path to a rules yaml file
Parameters
Name | Type | Description | Default |
---|---|---|---|
rules |
list[dict, …] | A list of rule dictionaries | [] |
rule_path |
str | A path to a rules .yml file | None |
Attributes
Name | Type | Description |
---|---|---|
rules | list[Rule, …] |
Methods
Name | Description |
---|---|
apply_ruleset | Apply the ruleset |
map_ruleset | Apply the ruleset to all sequences |
read_ruleset | read in a ruleset |
apply_ruleset
rule_classes.RuleSet.apply_ruleset(obj)
Apply the ruleset
The rules are checked against the Sequence interval in sequence, and the first one applies, ceasing rule’ application.
Parameters
Name | Type | Description | Default |
---|---|---|---|
obj |
SequenceInterval | The SequenceInterval undergoing rule application | required |
map_ruleset
rule_classes.RuleSet.map_ruleset(obj)
Apply the ruleset to all sequences
Parameters
Name | Type | Description | Default |
---|---|---|---|
obj |
SequenceTier | A sequence tier to be recoded | required |
read_ruleset
rule_classes.RuleSet.read_ruleset(path)
read in a ruleset
Parameters
Name | Type | Description | Default |
---|---|---|---|
path |
str | A path to a ruleset | required |
Raises
Type | Description |
---|---|
Exception | Any errors in reading in the ruleset |