Source code for pygenprop.functional_element

#!/usr/bin/env python

Created by: Lee Bergstrand (2017)

Description: The functional element class.
from pygenprop.step import Step

[docs]class FunctionalElement(object): """A functional element (enzyme, structural component or sub-genome property) that can carry out a step.""" def __init__(self, identifier, name, evidence: list=None, required=False, parent: Step=None): """ Creates a new FunctionalElement object. :param identifier: The identifier of the FunctionalElement. :param name: The name of the FunctionalElement. :param evidence: A list of Evidence objects supporting this FunctionalElement. :param required: Is this a required FunctionalElement for this functional_element? """ if evidence is None: evidence = [] else: # Double link evidences back to the parent functional element. for current_evidence in evidence: current_evidence.parent = self if required is None: required = False if name is None: name = identifier = identifier = name self.evidence = evidence self.required = required self.parent = parent def __repr__(self): repr_data = ['ID: ' + str(, 'Name: ' + str(, 'Evidences: ' + str(self.evidence), 'Required: ' + str(self.required)] return '(' + ', '.join(repr_data) + ')'