本文整理汇总了Python中cadnano.strand.Strand.abstractSeq方法的典型用法代码示例。如果您正苦于以下问题:Python Strand.abstractSeq方法的具体用法?Python Strand.abstractSeq怎么用?Python Strand.abstractSeq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cadnano.strand.Strand
的用法示例。
在下文中一共展示了Strand.abstractSeq方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sequenceExport
# 需要导入模块: from cadnano.strand import Strand [as 别名]
# 或者: from cadnano.strand.Strand import abstractSeq [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