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


Python Strand.abstractSeq方法代碼示例

本文整理匯總了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
開發者ID:hadim,項目名稱:cadnano2.5,代碼行數:49,代碼來源:oligo.py


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