Best solution, and it worked.
I want to produce the reverse-complement of each sequence in fastq files. I tried fastx_reverse_complement in FASTX-Toolkit. But following an error message were obtained. fastx_reverse_complement: Invalid quality score value (char '#' ord 35 quality value -29) on line 4
Are there any problems ? Are there any software producing the reverse-complement of each sequence in fastq files?
2 answers
You may try seqkit (v0.4.5 or later, run seqkit version to check version), which provides executable binary files for Linux/Windows/OS X. Just download, decompress and immediately use.
$ seqkit seq t.fq.gz
@K00137:236:H7NLVBBXX:6:1126:29721:23241 1:N:0
TGGTAGGGAGTTGAGTAGCATGGGTATAGTATAGTGTCATGATGCCAGATTTTAAAAAAAATACTGGAGA
+
```eeiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
$ seqkit seq -r -p t.fq.gz
@K00137:236:H7NLVBBXX:6:1126:29721:23241 1:N:0
TCTCCAGTATTTTTTTTAAAATCTGGCATCATGACACTATACTATACCCATGCTACTCAACTCCCTACCA
+
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiee```
All in one:
seqkit seq -r -p t.fq.gz | gzip -c > new.fq.gz # faster
or
seqkit seq -r -p t.fq.gz -o new.fq.gz
But, it seems nobody reverses complement FASTQ sequences.
Thanks shenwei356 for your answer! You said, "nobody reverses complement FASTQ sequences," but I'm wondering: do you think it makes sense to reverse complement if you have mate-pair reads in a reverse-forward orientation that you want to feed into an assembler that normally accepts reads in a forward-reverse orientation? That's what is done in https://thegenomefactory.blogspot.com/2012/09/using-velvet-with-mate-pair-sequences.html.
The error says you have an invalid quality score so perhaps you can't have negative quality score values such as -29 in the example you provided. Hope this helps.
Log in to answer this question.
I think you can write your script to get the reverse complement using biopython.
Maybe your version of FASTX-Toolkit is too old ?
Edit: link to the commit that deprecated
-Q33.See bowtie "Saw ASCII character -54 but expected 33-based Phred qual." after -Q 33 fastx reverse complement for a possible solution.
Can you explain to me why you are after the reverse complement of the FASTQ sequences please? Thanks.