I was able to get the bam by first getting the genome file (from the command below) that has only chr name and length then using this in the bedtobam command.
cat file.fa | awk '$0 ~ ">" {print c; c=0;printf substr($0,2,100) "\t"; } $0 !~ ">" {c+=length($0);} END { print c; }' > xx.genome
Thanks
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
-gexpectsfasta? 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
faiis 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 informationbedtoolsexpect - the sequence name and it's length.fin swimmer