import time
start = time.time()
import glob
import gzip
length=[]
with gzip.open('H-CK-1-3_clean.fq.gz','rt') as fp:
i = 0
for line in fp:
i += 1
if i % 4 == 2:
if len(line)-1==50:
length.append(i-1)
length.append(i)
length.append(i+1)
length.append(i+2)
output_fastq = open("temp1.fq",'w')
def WRIRE1():
N= 0
with gzip.open('H-CK-1-3_clean.fq.gz','rt') as fp:
for line in fp:
N += 1
if N in length:
output_fastq.write(line)
WRIRE1()
output_fastq.close()
end = time.time()
print("used %s s" % str(end - start))