这道题要求求出一个fastq文件中序列的cg含量
with open("Test1.fastq","r") as f:
lines = f.readlines()
seq = []
index = []
cg_n = []
cg_percentage = []
head = ['Read', 'CG']
cg = open("cg.txt","w")
#这里精髓,取出每条序列的标题
for line in lines:
if lines.index(line) %4== 0:
index.append(line.split(" ")[0].split(":",