Question: bedtools getfasta for mm9 genome
0
gravatar for rishi
16 months ago by
rishi10
rishi10 wrote:

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 • 1.1k views
ADD COMMENTlink modified 16 months ago • written 16 months ago by rishi10
1

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

ADD REPLYlink written 16 months ago by WouterDeCoster39k

That was my first try, didn't work.

ADD REPLYlink written 16 months ago by rishi10
3
gravatar for Jeffin Rockey
16 months ago by
Jeffin Rockey1.1k
Karimannoor
Jeffin Rockey1.1k wrote:

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 COMMENTlink written 16 months ago by Jeffin Rockey1.1k

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

ADD REPLYlink written 16 months ago by rishi10

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 REPLYlink written 16 months ago by WouterDeCoster39k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1977 users visited in the last hour