Problem succesfully running freebayes
1
0
Entering edit mode
4.3 years ago
ja4123 ▴ 20

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

please, mark the previous answers as answered. Green tick on the left. A: File not suitable for fasta index generation. C: Unable to find FASTA index entry for '1'

ADD REPLY
0
Entering edit mode

what is the output of cut -f 1 ref.fa.fai ?

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

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

ADD REPLY
1
Entering edit mode
4.3 years ago

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.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

find the original REF file that was used to produced the BAM file. Rename the contigs and the dictionary of the VCF file using the REF. VCF files: Change Chromosome Notation ; changing of chromosome notation in CHROM columns of vcf file ; ...

ADD REPLY

Login before adding your answer.

Traffic: 2604 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