Unable to find FASTA index entry for '/mountpoint/fastQ/Homo_sapiens_assembly38-3.sorted.bed.gz'
1
0
Entering edit mode
17 months ago

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 • 1.5k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

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 ?

ADD REPLY
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

enter image description here

Here you are the fasta file

ADD REPLY
0
Entering edit mode

it looks ok. Please , don't use screenhots.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
17 months ago

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.

ADD COMMENT
0
Entering edit mode

It works. Thanks a lot!

ADD REPLY
0
Entering edit mode

Upvote if helpful ;-)

ADD REPLY

Login before adding your answer.

Traffic: 1777 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6