Question: Generate hg19.fa file from hg19.bt2 index files - bowtie2-inspect???
0
gravatar for nash.claire
3.5 years ago by
nash.claire340
Canada
nash.claire340 wrote:

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!!!

myposts rna-seq sequence genome • 2.1k views
ADD COMMENTlink modified 3.5 years ago • written 3.5 years ago by nash.claire340

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 REPLYlink written 3.5 years ago by Matt Shirley9.0k

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 REPLYlink modified 3.5 years ago • written 3.5 years ago by h.mon25k
2
gravatar for Antonio R. Franco
3.5 years ago by
Spain. Universidad de Córdoba
Antonio R. Franco4.0k wrote:
Have you tried bowtie2-inspect hg19 >hg19.fa ?
ADD COMMENTlink written 3.5 years ago by Antonio R. Franco4.0k
0
gravatar for nash.claire
3.5 years ago by
nash.claire340
Canada
nash.claire340 wrote:

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 COMMENTlink written 3.5 years ago by nash.claire340
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: 723 users visited in the last hour