Generate hg19.fa file from hg19.bt2 index files - bowtie2-inspect???
2
0
Entering edit mode
8.4 years ago
nash.claire ▴ 490

Hi all,

I have had a search across various forums and can't find an answer to what I need.

I'm wondering if there is a way to generate a complete hg19.fa sequence fasta file from my already downloaded hg19.bt2 index files? So basically the reverse of bowtie2-build? I read a couple of forums (plus the Bowtie2 manual) which hint at using bowtie2-inspect. I tried this just using the simple command

bowtie2-inspect hg19

from within my bowtie_indexes directory and it seemed to work but only printing the fasta sequence onto the terminal screen and didn't appear to actually save a fasta file anywhere. Looking at the bowtie2 manual, there aren't a lot of options for parameters which you can set. I have just run the same command again using the -e parameter

bowtie2-inspect -e hg19

as it (very) briefly said in the manual something about reconstructing the reference but seems to hint that this is more used for colorspace.

Can anyone point me in the right direction? FYI, I don't actually need this file myself, I'm quite happy running bowtie2/tophat2 with the index files but my colleague needs a fasta file for use with SpliceMap in R and we'd rather not have to download the whole 30Gb file over our somewhat disappointing work internet connection!

RNA-Seq genome sequence • 4.6k views
ADD COMMENT
0
Entering edit mode

Your question has been answered by Antonio, but I would add that you can get the 2bit file from UCSC, at ~0.75GB and use the twoBitToFasta tool to generate fasta. Or, just download the gzipped fasta from somewhere - it's not going to be 30GB.

ADD REPLY
0
Entering edit mode

The "trick" Antonio showed, using >, is part of IO redirection. To learn more, see a simple question and answer here, or read the more complete and complex Bash Scripting Guide.

edit: is the hg19 reference really a 30Gb download?

ADD REPLY
2
Entering edit mode
8.4 years ago

Have you tried

bowtie2-inspect hg19 >hg19.fa

?

ADD COMMENT
0
Entering edit mode
8.4 years ago
nash.claire ▴ 490

Hi,

Thank you for replying. In the end, I was doing another tophat2 run so I just used the -keep-tmp option which saved the fasta file that bowtie2 makes in the process. I'm sure there are better ways to do that but since I was running tophat2 anyway, this was the easiest and quickest option!

As always, thanks for the help, this forum is a god send!

ADD COMMENT

Login before adding your answer.

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