I have several Fastq files where I am missing lines of data sporadically throughout. For example here is a correct read with all four lines
@M01698:289:000000000-AVDJ5:1:1101:15411:3896 1:N:0:GTGAATCC+TCCAGGTA
CGCGGCGATGGCGGAGCTGAATTACATTCCCAAC
+
GGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHG
and then the very next read is just two lines without the sequence and quality score data
@M01698:289:000000000-AVDJ5:1:1101:19764:3903 1:N:0:GTGAATCC+TCCAGGTA
+
Is there a way of finding these specific, not complete reads and simply adding an empty line above and below to make it a complete read?
g=open(New file,"w")
while True:
ID = f.readline()
if ID == '':
break
seq = f.readline()
ID2 = f.readline()
qs = f.readline()
if seq.contains("+"):
newseq=seq.replace("/n" "+" "/n")
else:
newseq=seq
g.write(ID)
g.write(newseq)
g.write(ID2)
g.write(qs)