python7

作者: rong酱 | 来源:发表于2021-05-23 23:59 被阅读0次
    # -*- coding: utf-8 -*-
    
    import os
    import fileinput
    
    keylist = []
    bamlines = open("n1.filter.sam","rb").readlines()
    for lines in bamlines:
        line = lines.strip().split("\t")
        for liness in line:
            if 'CR' in liness:
                barcode = liness.strip().split(":")[-1]
                name = "n1.filter.TAG_CB_" + str(barcode)
                if barcode not in keylist:
                    keylist.append(barcode)
                    os.system('touch %s'%(name))
                    content = open(name,"w")
                    content.write(lines)
                else:
                    content.write(lines)
    

    不念往事,立足现在

    相关文章

      网友评论

          本文标题:python7

          本文链接:https://www.haomeiwen.com/subject/ibbvdltx.html