This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem succesfully running freebayes

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

Before change headers in fasta from chr1, chr2 .. to 1, 2, 3 ... , I had error:

unable to find FASTA index entry for '1'

Now, after change I have:

unable to find FASTA index entry for 'chr1'

Could you give me some advice?

freebayes vcf fasta

Something like that: chr1 chr10 chr11 chr11_KI270721v1_random chr12 chr13 chr14 chr14_GL000009v2_random chr14_GL000225v1_random chr14_KI270722v1_random

and so on.

Numbers from 1 to 64185939 - in second case

and what is the output of gunzip -c in.vcf.gz | grep -v '# ' | cut -f 1 | uniq
as well as the output of samtools view -H aln.bam | grep '^@SQ' |cut -f 2

gunzip -c in.vcf.gz | grep -v '# ' | cut -f 1 | uniq

output are metadata from vcf and column #CHROM, that is: chr1 chr2 chr3 chr4 chr5 chr6 chr7 chr8 chr9 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 chr19 chr20 chr21 chr22 chrX chrY chr1_KI270706v1_random chr4_GL000008v2_random chr7_KI270803v1_alt chr15_KI270850v1_alt

samtools view -H aln.bam | grep '^@SQ' |cut -f 2

output:

SN:1 SN:2 SN:3 SN:4 SN:5 SN:6 SN:7 SN:8 SN:9 SN:10 SN:11 SN:12 SN:13 SN:14 SN:15 SN:16 SN:17 SN:18 SN:19 SN:20 SN:21 SN:22 SN:X SN:Y SN:MT SN:GL000207.1 SN:GL000226.1 SN:GL000229.1 SN:GL000231.1 SN:GL000210.1 SN:GL000239.1 SN:GL000235.1 SN:GL000201.1 SN:GL000247.1 SN:GL000245.1 SN:GL000197.1 SN:GL000203.1 SN:GL000246.1 SN:GL000249.1 SN:GL000196.1 SN:GL000248.1 SN:GL000244.1 SN:GL000238.1 SN:GL000202.1 SN:GL000234.1 SN:GL000232.1 SN:GL000206.1 SN:GL000240.1 SN:GL000236.1 SN:GL000241.1 SN:GL000243.1 SN:GL000242.1 SN:GL000230.1 SN:GL000237.1 SN:GL000233.1 SN:GL000204.1 SN:GL000198.1 SN:GL000208.1 SN:GL000191.1 SN:GL000227.1 SN:GL000228.1 SN:GL000214.1 SN:GL000221.1 SN:GL000209.1 SN:GL000218.1 SN:GL000220.1 SN:GL000213.1 SN:GL000211.1 SN:GL000199.1 SN:GL000217.1 SN:GL000216.1 SN:GL000215.1 SN:GL000205.1 SN:GL000219.1 SN:GL000224.1 SN:GL000223.1 SN:GL000195.1 SN:GL000212.1 SN:GL000222.1 SN:GL000200.1 SN:GL000193.1 SN:GL000194.1 SN:GL000225.1 SN:GL000192.1

1 answer

you're using a set of file BAM/vcf/ref that don't use the same dictionary (=chromosomes names, chr suffix , order of the chromosomes). The program will only work if the BAM/REF/VCF use the same dictionary.

Okey, so any advise which file has to bo modified and which way?

Log in to answer this question.