This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to find FASTA index entry for '/mountpoint/fastQ/Homo_sapiens_assembly38-3.sorted.bed.gz'

I'm trying to use freebayes to call variants through the following parameters : freebayes -f $REF -r $REGIONS -b 03.align/$FQ.align.sort.marked.bam > 04.freebayes/$FQ.var.vcf

The error reports: unable to find FASTA index for bed file. I have both .fasta and .fasta.fai file and all the other file created by indexing the reference genome (.alt, .btw, .sa,..)

How can I overcome this issue?

Thanks in advance

regions freebayes index bedfile

Fasta file downloaded from aws-GATK, bed file from UCSC. Are both index format 0-based? Maybe the formats are uncompatible

enter image description hereenter image description hereExactly the same. They end up with HLA-DRB1 contigs. Otherwise, bed file end with chrY. Can be this the problem?

1) this is not the output I asked; I want the fasta.fai but you ran the bed. 2) why a screenshot when you can just copy-n-paste the text ?

what are the outputs of

samtools view -H your.align.sort.marked.bam | grep '^@SQ' | cat -n |tail

and

cat -n /path/to/your/ref.fa.fai | tail

Sorry, this is my first question I posed on this forum. I've run GATK variant calling and it works well. The problem is related to freebayes tool. The command works if I do not specify the regions but only the fasta and bam file.

Should I try to convert bed file to fasta, indexing it and then use it as regions flag for freebayes tool?

1 answer

the syntax for the option -r is

   -r --region <chrom>:<start_position>-<end_position>

not a BED file. You want

-t --targets FILE Limit analysis to targets listed in the BED-format FILE.

furthermore, all the chromosomes in the bed file should be found in the fasta.fa.fai file. The following must be empty :

comm -32 <(cut -f1 select.bed | sort | uniq ) <(cut -f 1 /path/to/fasta.fa.fai |sort)

I'm not sure wether freebayes handles compressed bed files.

Log in to answer this question.