Is there a recommended way of converting FASTQ qualities? E.g., I read a phred64-encoded file with FastqStreamer, which gives me a ShortReadQ object with a quality of type SFastqQuality. After some manipulation I want to write it as phred33. For some reason I had thought I could write like this
No idea where I got that from, but it does not seem to work anyway.
I can come up with something like this
> fq2 <- ShortReadQ(sread=sread(fq), id=id(fq), quality=relist(BString(intToUtf8(t(as(quality(fq),"matrix"))+33L)), quality(fq)@quality)) # and in fact > identical(as(quality(fq),"matrix"),as(quality(fq2),"matrix"))  TRUE > writeFastq(fq2,file="bar.fq.gz")
but this is hardly the pinnacle of elegance?