This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to find FASTA index entry for '1'

Hey, I have a sorted and indexed .bam file, and I am running it through freebayes, with the script :

freebayes -f ref.fa -@ in.vcf.gz aln.bam >var.vcf

very time I run this script I get the:

unable to find FASTA index entry for '1'

Even know I have the index files.

I have the correct Bam file (downloaded from here: https://www.internationalgenome.org/data-portal/sample/NA12878) and index files and it just continually throws the indexing error. What could be the problem here?

freebayes fasta vcf bam

Hello again, there is another problem, I have changed the headers in fasta file. Now I have error as follows:

index file index.fai not found, generating...
ERROR: mismatched line lengths at line 39028338 within sequence 
File not suitable for fasta index generation.

It is necessery to change prefix in vcf file insted of fasta? Could you give me some advice?

Please use ADD REPLY/ADD COMMENT when responding to existing posts to keep threads logically organized.

This also is unrelated to your original question and should be posted as a new question. BTW if @Pierre's answer solved your original problem you should mark this answer as accepted (green check mark).

1 answer

I'm pretty sure your VCF contains chromosomes named 1, 2,3,4... while the fasta uses a chr prefix "chr1","chr2","chr3",...

There is some quick way to change prefix in one of that two files?

Log in to answer this question.