Hello every one, I repeatedly encountered this error whie trying to get bam from bed using the command below. I have tried to see solutions from previous question but it hasnt worked. also consulted the command usage and no way.
bedtools bedtobam -i x.bed -g y.fasta > x.bam
the error is also shown below, what am I doing wrong or what is wrong with my fasta file?
Less than the req'd two fields were encountered in the genome file (y.fasta) at line 1. Exiting.
What makes you think the argument to -g is a fasta file? Documentation suggests differently. Googling for "bedtools genome file" should put you on the right track.
Are you sure
-g
expectsfasta
? If I remember correct it only requires chromosome sizes file in 2 columns.The usage says -g <genome> . then it say fai should work with bedtools in the documentation
fai
is the index file of your reference sequence file. You can create it withsamtools faidx <genome>
. And this file works, because the first two columns in this file contain exactly the informationbedtools
expect - the sequence name and it's length.fin swimmer