# -*- 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)
不念往事,立足现在
网友评论