當前位置: 首頁>>代碼示例>>Python>>正文


Python Strand.connection5p方法代碼示例

本文整理匯總了Python中cadnano.strand.Strand.connection5p方法的典型用法代碼示例。如果您正苦於以下問題:Python Strand.connection5p方法的具體用法?Python Strand.connection5p怎麽用?Python Strand.connection5p使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cadnano.strand.Strand的用法示例。


在下文中一共展示了Strand.connection5p方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _strandMergeUpdate

# 需要導入模塊: from cadnano.strand import Strand [as 別名]
# 或者: from cadnano.strand.Strand import connection5p [as 別名]
    def _strandMergeUpdate(self, old_strand_low: Strand,
                                old_strand_high: Strand,
                                new_strand: Strand):
        """This method sets the isCircular status of the oligo and the oligo's
        5' strand.
        """
        # check loop status
        if old_strand_low.oligo() == old_strand_high.oligo():
            self._is_circular = True
            self._strand5p = new_strand
            return
            # leave the _strand5p as is?
        # end if

        # Now get correct 5p end to oligo
        if old_strand_low.isForward():
            if old_strand_low.connection5p() is not None:
                self._strand5p = old_strand_low.oligo()._strand5p
            else:
                self._strand5p = new_strand
        else:
            if old_strand_high.connection5p() is not None:
                self._strand5p = old_strand_high.oligo()._strand5p
            else:
                self._strand5p = new_strand
開發者ID:cadnano,項目名稱:cadnano2.5,代碼行數:27,代碼來源:oligo.py

示例2: __init__

# 需要導入模塊: from cadnano.strand import Strand [as 別名]
# 或者: from cadnano.strand.Strand import connection5p [as 別名]
    def __init__(self, strandset: StrandSetT, strand: Strand, solo: bool = True):
        super(RemoveStrandCommand, self).__init__("remove strands")
        self._strandset = strandset
        self._strand = strand
        self._solo = solo
        self._old_strand5p = strand.connection5p()
        self._old_strand3p = strand.connection3p()
        self._oligo = olg = strand.oligo()

        part = strand.part()
        # idxs = strand.idxs()
        self.mids = (part.getModID(strand, strand.lowIdx()),
                     part.getModID(strand, strand.highIdx()))

        # only create a new 5p oligo if there is a 3' connection
        self._new_oligo5p = olg.shallowCopy() if self._old_strand5p else None
        if olg.isCircular() or self._old_strand3p is None:
            self._new_oligo3p = olg3p = None
            if self._new_oligo5p:
                self._new_oligo5p._setLoop(False)
        else:
            self._new_oligo3p = olg3p = olg.shallowCopy()
            olg3p.setStrand5p(self._old_strand3p)
            # color_list = styles.STAP_COLORS if strandset.isStaple() else prefs.SCAF_COLORS
            color_list = pathstyles.STAP_COLORS
            color = random.choice(color_list)
            olg3p._setColor(color)
            olg3p.refreshLength(emit_signals=True)
開發者ID:cadnano,項目名稱:cadnano2.5,代碼行數:30,代碼來源:removestrandcmd.py

示例3: _strandSplitUpdate

# 需要導入模塊: from cadnano.strand import Strand [as 別名]
# 或者: from cadnano.strand.Strand import connection5p [as 別名]
 def _strandSplitUpdate(self, new_strand5p: Strand,
                             new_strand3p: Strand,
                             oligo3p: OligoT,
                             old_merged_strand: Strand):
     """If the oligo is a loop, splitting the strand does nothing. If the
     oligo isn't a loop, a new oligo must be created and assigned to the
     new_strand and everything connected to it downstream.
     """
     # if you split it can't be a loop
     self._is_circular = False
     if old_merged_strand.oligo().isCircular():
         self._strand5p = new_strand3p
         return
     else:
         if old_merged_strand.connection5p() is None:
             self._strand5p = new_strand5p
         else:
             self._strand5p = old_merged_strand.oligo()._strand5p
         oligo3p._strand5p = new_strand3p
開發者ID:cadnano,項目名稱:cadnano2.5,代碼行數:21,代碼來源:oligo.py


注:本文中的cadnano.strand.Strand.connection5p方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。