本文整理匯總了Python中cadnano.strand.Strand.connectionHigh方法的典型用法代碼示例。如果您正苦於以下問題:Python Strand.connectionHigh方法的具體用法?Python Strand.connectionHigh怎麽用?Python Strand.connectionHigh使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cadnano.strand.Strand
的用法示例。
在下文中一共展示了Strand.connectionHigh方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from cadnano.strand import Strand [as 別名]
# 或者: from cadnano.strand.Strand import connectionHigh [as 別名]
def __init__(self, strand_low: Strand,
strand_high: Strand,
priority_strand: Strand):
super(MergeCommand, self).__init__("merge strands")
# Store strands
self._strand_low = strand_low
self._strand_high = strand_high
self._s_set = s_set = priority_strand.strandSet()
# Store oligos
self._new_oligo = priority_strand.oligo().shallowCopy()
self._s_low_oligo = s_low_olg = strand_low.oligo()
self._s_high_oligo = s_high_olg = strand_high.oligo()
# self._s_set_idx = low_strandset_idx
# update the new oligo length if it's not a loop
if s_low_olg != s_high_olg:
self._new_oligo._setLength(s_low_olg.length() + s_high_olg.length(),
emit_signals=True)
# Create the new_strand by copying the priority strand to
# preserve its properties
new_idxs = strand_low.lowIdx(), strand_high.highIdx()
new_strand = strand_low.shallowCopy()
new_strand.setIdxs(new_idxs)
new_strand.setConnectionHigh(strand_high.connectionHigh())
self._new_strand = new_strand
# Update the oligo for things like its 5prime end and isCircular
self._new_oligo._strandMergeUpdate(strand_low, strand_high, new_strand)
# set the new sequence by concatenating the sequence properly
if strand_low._sequence or strand_high._sequence:
tL = strand_low.totalLength()
tH = strand_high.totalLength()
seqL = strand_low._sequence if strand_low._sequence else "".join([" " for i in range(tL)])
seqH = strand_high._sequence if strand_high._sequence else "".join([" " for i in range(tH)])
if new_strand.isForward():
new_strand._sequence = seqL + seqH
else:
new_strand._sequence = seqH + seqL