source¶
Represents a collection of data about a Source feature that is commonly used to maintain and update SEA-PHAGES phage genomics data.
- class pdm_utils.classes.source.Source¶
Bases:
object
- check_attribute(attribute, check_set, expect=False, eval_id=None, success='correct', fail='error', eval_def=None)¶
Check that the attribute value is valid.
- Parameters
attribute (str) – Name of the Source feature object attribute to evaluate.
check_set (set) – Set of reference ids.
expect (bool) – Indicates whether the attribute value is expected to be present in the check set.
eval_id (str) – Unique identifier for the evaluation.
success (str) – Default status if the outcome is a success.
fail (str) – Default status if the outcome is not a success.
eval_def (str) – Description of the evaluation.
- parse_host()¶
Retrieve the host_genus name from the ‘host’ field.
- parse_lab_host()¶
Retrieve the host_genus name from the ‘lab_host’ field.
- parse_organism()¶
Retrieve the phage and host_genus names from the ‘organism’ field.
- set_eval(eval_id, definition, result, status)¶
Constructs and adds an Evaluation object to the evaluations list.
- Parameters
eval_id (str) – Unique identifier for the evaluation.
definition (str) – Description of the evaluation.
result (str) – Description of the outcome of the evaluation.
status (str) – Outcome of the evaluation.