当前位置: 首页>>代码示例>>Python>>正文


Python Strand.sequence方法代码示例

本文整理汇总了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
开发者ID:Rebelofold,项目名称:cadnano2.5,代码行数:11,代码来源:oligo.py

示例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
开发者ID:hadim,项目名称:cadnano2.5,代码行数:16,代码来源:oligo.py

示例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
开发者ID:hadim,项目名称:cadnano2.5,代码行数:49,代码来源:oligo.py

示例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
开发者ID:Rebelofold,项目名称:cadnano2.5,代码行数:23,代码来源:oligo.py


注:本文中的cadnano.strand.Strand.sequence方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。