This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fastx_toolkit with nanopore data

Hi, I am trying to convert a fastq file (containing multiple sequences) to a fasta file using fastx_toolkit (Hannon lab). However I get this error message:

fastq_to_fasta: Error: invalid quality score data on line 68 (quality_tok = "ATATGCGTGCCATTG...etc)

I notice on another thread that you can put -Q33 to tell it you are using Illumina quality scores. Does anyone know if there is an equivalent flag to tell it I am using nanopore data?

If not can anyone recommend another way to convert these files?

Thank you!

nanopore fastx fastq fasta

You could try Q33 with Nanopore data which I am sure uses sanger fastq format.

You could also use reformat.sh in=your.fastq out=your.fasta from BBMap suite to achieve the same result.

Edit: If you are using FAST5 format files as input then use poretools as suggested by Iñigo Prada .

You might have to add qin=33 to the reformat.sh making it reformat.sh qin=33 in=your.fastq out=your.fasta otherwise you might get Warning! Changed from ASCII-33 to ASCII-64 on input ;: 59 -> 28.

1 answer

You can easily do that conversion using biopython:

from Bio import SeqIO 
count = SeqIO.convert("input.fastq", "fastq", "output.fasta", "fasta")
print("Converted %i records" % count)

Log in to answer this question.