FASTQ to FASTA converter
Paste reads or open a FASTQ file. It is converted on your device, nothing is uploaded.
·
Paste reads or open a FASTQ file. It is converted on your device, nothing is uploaded.
·
A FASTQ record has four parts: a header line starting with @, the sequence, a separator line starting with +, and a quality string with exactly one character per base. A FASTA record has only a header starting with > and the sequence. The conversion keeps the first two parts and discards the rest:
| FASTQ | FASTA |
|---|---|
| @read1 sample=A | >read1 sample=A |
| GATTACA | GATTACA |
| + | dropped |
| IIIH#5+ | dropped |
Aligners and variant callers need the qualities, so keep the original FASTQ. FASTA is what BLAST, multiple alignment programs, primer design tools and most web forms expect.
A Phred score Q expresses the probability P that a base call is wrong, and it is stored as a single printable character:
Q20 means a 1 in 100 chance of error, Q30 1 in 1,000, Q40 1 in 10,000. For the read above, the quality string IIIH#5+ decodes to 40, 40, 40, 39, 2, 20 and 10. The sum is 191 over 7 bases, so the tool reports a mean quality of Q27.3. The figure is the arithmetic mean of the Phred scores, which is how most read filters define it. Because the scale is logarithmic, a few very poor bases raise the true average error rate more than this mean suggests.
Almost every current file is Phred+33: Sanger, Illumina 1.8 and later, Ion Torrent, PacBio and Oxford Nanopore. Illumina pipelines 1.3 to 1.7 (roughly 2009 to 2011) wrotePhred+64, where the lowest character is @. The tool inspects the range of quality characters: anything below ; (ASCII 59) can only be Phred+33, while a file whose characters all lie at or above 59 and reach beyond J is read as Phred+64. A handful of uniformly high-quality reads can be ambiguous, so the encoding can be set by hand once there is input.
Standard four-line records, and also the older wrapped layout in which sequence and quality run over several lines. In that layout a quality line may itself begin with @, so the parser does not look for the next header; it reads quality characters until it has as many as there are bases. A record whose quality string is longer or shorter than its sequence, or that is cut off at the end of the file, is skipped and reported with its line number rather than silently dropped. Repeated read names after the + are accepted, and Windows line endings and blank lines are ignored.
With a minimum mean quality set, a read is kept when the mean of its Phred scores is at least that value. Q20 is a common floor for Illumina data, and Q7 to Q10 for Nanopore reads. With a minimum length set, shorter reads are removed, for example adapter dimers left after trimming. The statistics always describe the whole input; the line above the FASTA shows how many reads passed.
A browser tab can comfortably handle files of some hundred megabytes. For whole sequencing runs the command line is faster and has no memory limit:
The sed one-liner assumes strict four-line records; seqtk also handles wrapped files.
Check the length distribution of the converted reads with thesequence length calculator, their base composition with theGC content calculator, or flip minus-strand reads with thereverse complement calculator.
Paste the reads or choose a FASTQ file. Each record keeps its name and sequence: the @ at the start of the header becomes >, and the + line and the quality line are dropped. Press Copy or Download to take the FASTA.
FASTA stores a name and a sequence. FASTQ stores a name, a sequence and one quality character per base, which encodes the probability that the base call is wrong. Converting FASTQ to FASTA discards the qualities, so it cannot be reversed.
Almost every current file is Phred+33: Sanger, Illumina 1.8 and later, Ion Torrent, PacBio and Nanopore. Only Illumina 1.3 to 1.7 wrote Phred+64. The converter detects the encoding from the range of quality characters, since anything below ; (ASCII 59) can only be Phred+33, and you can set it by hand when a file is ambiguous.
Yes, in current browsers. A .gz file is decompressed locally before it is parsed. Very large files can exceed the memory of a browser tab; for those, seqtk seq -a on the command line is the better tool.
Each quality character is converted to a Phred score (ASCII code minus 33, or minus 64 for old Illumina files) and the scores are averaged. The filter uses the same arithmetic mean per read.