bedtools getfasta for mm9 genome
1
0
Entering edit mode
6.8 years ago
rishi ▴ 10

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?

genome • 3.8k views
ADD COMMENT
1
Entering edit mode

What about using cat *.fa > mm9.fa?

ADD REPLY
0
Entering edit mode

That was my first try, didn't work.

ADD REPLY
3
Entering edit mode
6.8 years ago
Jeffin Rockey ★ 1.3k

Do a cat bed-file | cut -f1 | sort | uniq and do a diff with your chromosome list. Most likely there will be some 'chr' or so prefix issue. If this doesn't work. Post the header list of fasta and few lines from input bed.

ADD COMMENT
0
Entering edit mode

Thanks a lot! It was a problem with the 'chr' prefix of my .bed file.

ADD REPLY
0
Entering edit mode

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

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