最近因为运行软件脚本丢失,所以决定以后存到网上,此脚本是比较fastq文件是否相同的行数序列相同
import gzip
from datetime import datetime
count=1
list1=[]
list2=[]
print("开始。。。。。")
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f1=gzip.open("/home/huilin_hu/Arabidopsis/fastq/57.fq.gz.split/57.R1.0001.fq.gz","rb")
f2=gzip.open("/home/huilin_hu/Arabidopsis/fastq/57.fq.gz.split/57.R2.0001.fq.gz","rb")
while 1:
line1=f1.readline()
line2=f2.readline()
# print(line1)
if count%4==1:
#print(line1)
id1=str(line1.decode().lstrip("@").split())
list1=(id1.replace("/1",""))
# print(list1)
id2=str(line2.decode().lstrip("@").split())
list2=(id2.replace("/2",""))
#print(list2)
if list1==list2:
l=list1
# print("第%d行内容是相同的,内容为:%s"%(count,list1))
else:
print("第%d行内容是不同的,内容为:%s"%(count,list1))
count+=1
if line1==b'':
break
print("结束。。。。。")
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))