Source code for immuneML.simulation.implants.MotifInstance
[docs]classMotifInstance:def__init__(self,instance:str,gap:int):assertgap==0orgap>0andinstance.find("/")!=-1,"MotifInstance: gap position is not indicated in the motif instance string. The " \
"gap will be inserted in place of '/' sign. Check if there is a '/' sign in the " \
"instance. "self.instance=instanceself.gap=gapdef__str__(self):returnself.instance.replace("/","".join(["/"for_inrange(self.gap)]))def__len__(self):returnlen(self.instance)+max(self.gap-1,0)