Here is quick and extremely dirty python script to pull out fastq quality not making assumptions about line wrapping:
import sys
inFile = open(sys.argv[1],'r')
header = ''
qual = ''
seqs = False
quals = False
for line in inFile:
if line[0] == "@":
if header != '':
print ">" + header
print qual
header = line[1:].strip()
quals = False
qual = ''
elif line[0] == "+":
quals = True
else:
if quals:
qual += line.strip()
print ">" + header
print qual
Save as yourName.py and run it by: python yourName.py yourFile.fastq > output.quals
edit *
There was a mistake in the code where the qual variable wasn't being reset.
edit **
Here is the script to get just one entry:
import sys
inFile = open(sys.argv[1],'r')
queryHeader = sys.argv[2]
header = ''
qual = ''
seqs = False
quals = False
for line in inFile:
if line[0] == "@":
if header != '':
if header == queryHeader:
print ">" + header
print qual
sys.exit()
header = line[1:].strip()
quals = False
qual = ''
elif line[0] == "+":
quals = True
else:
if quals:
qual += line.strip()
print ">" + header
print qual
Save it as yourName.py. Use it by: python yourName.py yourFile.fastq "entry name"
I've added the scrip for getting just one entry. Make sure you typed the name of the entry correctly with quotes if there are spacing. If you didn't type it correctly, it will just give you the last entry.
It quality doesn't wrap lines can't you just grep for "+"?