本文整理汇总了Python中cadnano.strand.Strand.sequence方法的典型用法代码示例。如果您正苦于以下问题:Python Strand.sequence方法的具体用法?Python Strand.sequence怎么用?Python Strand.sequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cadnano.strand.Strand
的用法示例。
在下文中一共展示了Strand.sequence方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sequence
# 需要导入模块: from cadnano.strand import Strand [as 别名]
# 或者: from cadnano.strand.Strand import sequence [as 别名]
def sequence(self):
temp = self.strand5p()
if not temp:
return None
if temp.sequence():
return ''.join([Strand.sequence(strand) \
for strand in self.strand5p().generator3pStrand()])
else:
return None
示例2: sequence
# 需要导入模块: from cadnano.strand import Strand [as 别名]
# 或者: from cadnano.strand.Strand import sequence [as 别名]
def sequence(self):
"""Get the sequence applied to this `Oligo`
Returns:
str or None
"""
temp = self.strand5p()
if not temp:
return None
if temp.sequence():
return ''.join([Strand.sequence(strand)
for strand in self.strand5p().generator3pStrand()])
else:
return None
示例3: sequenceExport
# 需要导入模块: from cadnano.strand import Strand [as 别名]
# 或者: from cadnano.strand.Strand import sequence [as 别名]
def sequenceExport(self, output):
""" Iterative appending to argument `output` which is a dictionary of
lists
Args:
output (dict): dictionary with keys given in `NucleicAcidPart.getSequences`
Returns:
dict:
"""
part = self.part()
vh_num5p = self.strand5p().idNum()
strand5p = self.strand5p()
idx5p = strand5p.idx5Prime()
seq = []
a_seq = []
if self.isLoop():
# print("A loop exists")
raise Exception
for strand in strand5p.generator3pStrand():
seq.append(Strand.sequence(strand, for_export=True))
a_seq.append(Strand.abstractSeq(strand))
if strand.connection3p() is None: # last strand in the oligo
vh_num3p = strand.idNum()
idx3p = strand.idx3Prime()
a_seq = ','.join(a_seq)
a_seq = "(%s)" % (a_seq)
modseq5p, modseq5p_name = part.getStrandModSequence(strand5p, idx5p,
ModType.END_5PRIME)
modseq3p, modseq3p_name = part.getStrandModSequence(strand, idx3p,
ModType.END_3PRIME)
seq = ''.join(seq)
seq = modseq5p + seq + modseq3p
# output = "%d[%d]\t%d[%d]\t%s\t%s\t%s\t%s\t(%s)\n" % \
# (vh_num5p, idx5p, vh_num3p, idx3p, self.getColor(),
# modseq5p_name, seq, modseq3p_name, a_seq)
# these are the keys
# keys = ['Start','End','Color', 'Mod5',
# 'Sequence','Mod3','AbstractSequence']
output['Start'].append("%d[%d]" % (vh_num5p, idx5p))
output['End'].append("%d[%d]" % (vh_num3p, idx3p))
output['Color'].append(self.getColor())
output['Mod5'].append(modseq5p_name)
output['Sequence'].append(seq)
output['Mod3'].append(modseq3p_name)
output['AbstractSequence'].append(a_seq)
return output
示例4: sequenceExport
# 需要导入模块: from cadnano.strand import Strand [as 别名]
# 或者: from cadnano.strand.Strand import sequence [as 别名]
def sequenceExport(self):
part = self.part()
vh_num5p = self.strand5p().virtualHelix().number()
strand5p = self.strand5p()
idx5p = strand5p.idx5Prime()
seq = ''
if self.isLoop():
# print("A loop exists")
raise Exception
for strand in strand5p.generator3pStrand():
seq = seq + Strand.sequence(strand, for_export=True)
if strand.connection3p() == None: # last strand in the oligo
vh_num3p = strand.virtualHelix().number()
idx3p = strand.idx3Prime()
modseq5p, modseq5p_name = part.getModSequence(strand5p, idx5p, 0)
modseq3p, modseq3p_name = part.getModSequence(strand, idx3p, 1)
seq = modseq5p + seq + modseq3p
output = "%d[%d],%d[%d],%s,%s,%s,%s,%s\n" % \
(vh_num5p, idx5p, vh_num3p, idx3p, seq, len(seq),
self._color, modseq5p_name, modseq3p_name)
return output