def upperLeftCornerOfBase(self, idx: int, strand: StrandT) -> Vec2T: """ Args: idx: the base index within the virtual helix strand: Description Returns: Tuple of upperLeftCornerOfBase """ x = idx * _BASE_WIDTH y = 0 if strand.isForward() else _BASE_WIDTH return x, y
def __init__(self, virtual_helix_item: PathVirtualHelixItemT, strand: StrandT, insertion: InsertionT): super(InsertionItem, self).__init__(virtual_helix_item) self.hide() self._strand = strand self._insertion = insertion self._seq_item = QGraphicsPathItem(parent=self) self._is_on_top = is_on_top = strand.isForward() y = 0 if is_on_top else _BW self.setPos(_BW*insertion.idx(), y) self.setZValue(styles.ZINSERTHANDLE) self._initLabel() self._initClickArea() self.updateItem() self.show()