FASTQ to FASTA converter

Paste reads or open a FASTQ file. It is converted on your device, nothing is uploaded.

·

FASTA

How do I convert FASTQ to FASTA?

  1. Paste the reads into the box, drop a file on it, or use Choose a file. Plain.fastq / .fq and gzipped .fastq.gz files are read on your device.
  2. The FASTA appears immediately, together with the read count, total bases, mean read length and mean Phred quality of the input.
  3. Optionally set a minimum mean quality or a minimum length to drop poor or short reads.
  4. Copy the FASTA or Download it as a .fasta file. For large inputs only the first reads are displayed, but Copy and Download always contain every read.

What is the difference between FASTQ and FASTA?

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:

FASTQFASTA
@read1 sample=A>read1 sample=A
GATTACAGATTACA
+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.

How is the mean Phred quality calculated?

A Phred score Q expresses the probability P that a base call is wrong, and it is stored as a single printable character:

Q = −10 · log10(P)     Q = ASCII code − 33

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.

Is my file Phred+33 or Phred+64?

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.

Which FASTQ files can it read?

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.

Filtering reads by quality and length

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.

Converting very large FASTQ files

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:

seqtk seq -a reads.fastq.gz > reads.fasta
sed -n '1~4s/^@/>/p;2~4p' reads.fastq > reads.fasta

The sed one-liner assumes strict four-line records; seqtk also handles wrapped files.

Related tools

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.

Frequently asked questions

How do I convert FASTQ to FASTA?

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.

What is the difference between FASTQ and 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.

Is my FASTQ file Phred+33 or Phred+64?

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.

Does it work with gzipped files (.fastq.gz)?

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.

How is the mean quality calculated?

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.