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