def removeStrand(self, strand: StrandT, use_undostack: bool = True, solo: bool = True): """Remove a :class:`Strand` from the set Args: strand: the :class:`Strand` to remove use_undostack (optional): default = ``True`` solo ( optional): solo is an argument to enable limiting signals emiting from the command in the case the command is instantiated part of a larger command, default=``True`` """ cmds = [] if not self.isStrandInSet(strand): raise IndexError("Strandset.removeStrand: strand not in set") if strand.sequence() is not None: cmds.append(strand.oligo().applySequenceCMD(None)) cmds += strand.clearDecoratorCommands() cmds.append(RemoveStrandCommand(self, strand, solo=solo)) util.execCommandList(self, cmds, desc="Remove strand", use_undostack=use_undostack)
def _updateColor(self, strand: StrandT): oligo = strand.oligo() color = SELECT_COLOR if self.isSelected() else oligo.getColor() if oligo.shouldHighlight(): alpha = 128 pen_width = styles.PATH_STRAND_HIGHLIGHT_STROKE_WIDTH else: pen_width = styles.PATH_STRAND_STROKE_WIDTH alpha = None self.xover_3p_end._updateColor(strand) pen = getPenObj(color, pen_width, alpha=alpha, capstyle=Qt.FlatCap) brush = getBrushObj(color, alpha=alpha) self.setPen(pen) self._low_cap.updateHighlight(brush) self._high_cap.updateHighlight(brush) self._dual_cap.updateHighlight(brush)
def _updateColor(self, strand: StrandT): """ Args: strand (TYPE): Description """ oligo = strand.oligo() color = self.pen().color().name() if self.isSelected( ) else oligo.getColor() if color is None: print("None color:", color, self.isSelected()) color = '#cc0000' if oligo.shouldHighlight(): pen_width = styles.PATH_STRAND_HIGHLIGHT_STROKE_WIDTH alpha = 128 else: pen_width = styles.PATH_STRAND_STROKE_WIDTH alpha = 255 pen = getPenObj(color, pen_width, alpha=alpha, capstyle=Qt.FlatCap) self.setPen(pen)
def __init__(self, strand_item, model_strand: StrandT): self._model_strand = model_strand self._model_oligo = model_strand.oligo() self._strand_item = strand_item self.connectSignals()