How do I download a reference genome that I can use with bowtie2? Specifically HG19. On UCSC there are a lot of file options.
A bit longer answer:
There are two components to "genome for a read mapper" such as Bowtie or BWA.
First, you need to choose the actual sequence (genome release such as GRCh37/hg19 or GRCh38/hg38). There are patch releases such as GRCh37.p3 where some bases might be exchanged and depending on the release, some "unmapped" loci contigs might be added, but generally GRCh37.p1 is roughly the same as GRCh37.p2, for example. Usually, people have agreed on some specific patch version for each read and use this for read mapping.
Generally, there is the UCSC flavour hg19/hg38 etc. and the NCBI/GRC flavour GRCh37, GRCh38 etc. (similar with mouse). UCSC has no versioning besides the genome release and (to the best of my knowledge) does not update the genome sequence after releasing a hg19 FASTA file.
Second, you have to build the index files for each genome. Depending on the read mapper you use, you might or might not need the original FASTA files for the alignment. For Bowtie and Bowtie 2, you don't need the original FASTA files after building the index as Bowtie 1/2 can reconstruct the sequence "on the fly" from the index files.
It’s a matter of preference I guess but I recommend the Ensembl builds. Decide whether you want the toplevel or primary assembly, and whether you want soft-masked, repeat-masked or unmasked files. The naming schema is very straightforward; the combinations are described in the
README file, and all files reside in one directory.
For example, if you want the unmasked primary assembly, the file to download would be
As for GoldenPath/UCSC, there’s no need to download and concatenate separate chromosomes (contrary to what the other answer said); you can download the whole (toplevel) reference from the
bigZips directory; from the
This directory contains the Feb. 2009 assembly of the human genome (hg19, GRCh37 Genome Reference Consortium Human Reference 37 (GCA_000001405.1)), as well as repeat annotations and GenBank sequences.
There are essentially three options here:
chromFa.tar.gz, which contains the whole genome in one chromosome per file;
chromFaMasked.tar.gz, the same with repeats masked by
hg19.2bit, which is the whole genome in one file, but needs to be extracted using the utility program
twoBitToFa, which needs to be downloaded separately.
In any case, I always download the reference and build my own index for mapping, since this allows me more control; not everybody might need this much control, but then building the index once is fairly fast anyway.