I downloaded the mm9 genome (all chromosomes) from UCSC (http://hgdownload-test.cse.ucsc.edu/goldenPath/mm9/chromosomes/) , and then concatenated them using the following code:
cat chr1.fa | cat - chr2.fa | cat - chr3.fa | cat - chr4.fa | cat - chr5.fa | cat - chr6.fa | cat - chr7.fa | cat - chr8.fa | cat - chr9.fa | cat - chr10.fa | cat - chr11.fa | cat - chr12.fa | cat - chr13.fa | cat - chr14.fa | cat - chr15.fa | cat - chr16.fa | cat - chr17.fa | cat - chr18.fa |cat - chr19.fa | cat - chrX.fa | cat - chrY.fa > mm9.fa
I expected that I got the whole genome fasta file, but when I used bedtools getfasta for my regions of interest:
bedtools getfasta -fi mm9.fa -bed *file* -tab -fo *file*
it gave me errors like this, for all the chromosomes:
WARNING. chromosome () was not found in the FASTA file. Skipping.
I used to grep to check, but all of my chromosomes are indeed present in the file. What am I doing wrong?
What about using
cat *.fa > mm9.fa
?That was my first try, didn't work.