import DISNET.objects.DisnetObject as DisnetObject class VariantObject(DisnetObject.DisnetObject): """Class to instance objects of type Variant""" def __init__(self, id: (str, int), chromosome: str, chroposition: str, consequence: str): DisnetObject.DisnetObject.__init__(self, id) self.__chromosome = chromosome self.__chroposition = chroposition self.__consequence = consequence def getChromosome(self) -> str: """Returns the chromosome of the Variant""" return self.__chromosome def getChroposition(self) -> str: """Returns the Chromosome Position of the Variant""" return self.__chroposition def getConsequence(self) -> str: """Returns the consequence of the Variant""" return self.__consequence def info(self) -> str: """Returns the information of the Variant as a string""" return "VariantObject: [id: " + self.getId() + ", chromosome: " + str(self.__chromosome) + \ ", chroposition: " + str(self.__chroposition) + ", consequence: " + str(self.__consequence) + "]" def __eq__(self, other) -> bool: """Equals to other Variant""" if isinstance(other, VariantObject): equalChromosome = self.__chromosome == other.getChromosome() equalID = self.getId() == other.getId() equalChroposition = self.__chroposition == other.getChroposition() equalConsequence = self.__consequence == other.getConsequence() return equalID and equalChromosome and equalChroposition and equalConsequence else: return False