racon: [bioparser::FastqParser] error: invalid file format!

I tried use fasta file from nanopore to polish my genome of ecoli with racon v1.3.1 here is my code

minimap2 ${draft_dir}/draft.fasta ${readpath}/reads.fasta > ONTmin_IT0.paf
time racon ${readpath}/reads.fasta ONTmin_IT0.paf ${draft_dir}/draft.fasta > ONTmin_IT1.fasta

and I get the error

[racon::Polisher::initialize] loaded target sequences
[bioparser::FastaParser] error: invalid file format!

Then I used the same fasta file to simulate a fastq file,and get the same error:

[racon::Polisher::initialize] loaded target sequences
[bioparser::FastqParser] error: invalid file format!

I used fastq as racon material without any problems before. this is my first time to use fasta file ,Is there anything different Between them? or is it because my genome is too small? Ecoli only has one sequence (4MB) and my fasta file is 1.5GB

thanks for your time huandna

About this issue

Most upvoted comments

I ran into this same error (and solved it, but I just wanted to leave this here in case it’s useful for anybody else in the future)

In my case it was because my fastq file contained reads of length 0. Performing a trimming step with minlen=1 (e.g. with trimmomatic) before running racon solved the issue for me.

Hi rvaser, I also run into the same error, and after tried the suggestions above, I think there might be something wrong with the Sam file, so i change my command “minimap2 -t 12 .fasta .fq.gz > .sam” to “minimap2 -t 12 .fasta .fq.gz -o .sam”, then run “racon -m 8 -x -6 -g -8 -w 500 -t 4 .fq.gz .sam .fasta” it’s working.

However you want 😃 If you want .sam, run Minimap2 with -a.

I find the issue grep > reads.fasta | wc -l get 164473 and wc -l reads.fasta get 328964,so it is my fault. I will recheck my fasta file.

Many thanks for your offer huanda