4 # Downloads sequence for the hg19 version of H. spiens (human) from
7 # Note that UCSC's hg19 build has three categories of compressed fasta
10 # 1. The base files, named chr??.fa.gz
11 # 2. The unplaced-sequence files, named chr??_gl??????_random.fa.gz
12 # 3. The alternative-haplotype files, named chr??_?????_hap?.fa.gz
14 # By default, this script builds and index for just the base files,
15 # since alignments to those sequences are the most useful. To change
16 # which categories are built by this script, edit the CHRS_TO_INDEX
48 chr1_gl000191_random \
49 chr1_gl000192_random \
50 chr4_gl000193_random \
51 chr4_gl000194_random \
52 chr7_gl000195_random \
53 chr8_gl000196_random \
54 chr8_gl000197_random \
55 chr9_gl000198_random \
56 chr9_gl000199_random \
57 chr9_gl000200_random \
58 chr9_gl000201_random \
59 chr11_gl000202_random \
60 chr17_gl000203_random \
61 chr17_gl000204_random \
62 chr17_gl000205_random \
63 chr17_gl000206_random \
64 chr18_gl000207_random \
65 chr19_gl000208_random \
66 chr19_gl000209_random \
67 chr21_gl000210_random \
119 CHRS_TO_INDEX=$BASE_CHRS
121 UCSC_HG19_BASE=ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19/chromosomes
125 if ! wget --version >/dev/null 2>/dev/null ; then
126 if ! curl --version >/dev/null 2>/dev/null ; then
127 echo "Please install wget or curl somewhere in your PATH"
130 curl -o `basename $1` $1
138 BOWTIE_BUILD_EXE=./bowtie-build
139 if [ ! -x "$BOWTIE_BUILD_EXE" ] ; then
140 if ! which bowtie-build ; then
141 echo "Could not find bowtie-build in current directory or in PATH"
144 BOWTIE_BUILD_EXE=`which bowtie-build`
149 for c in $CHRS_TO_INDEX ; do
150 if [ ! -f ${c}.fa ] ; then
152 get ${UCSC_HG19_BASE}/$F || (echo "Error getting $F" && exit 1)
153 gunzip $F || (echo "Error unzipping $F" && exit 1)
155 [ -n "$INPUTS" ] && INPUTS=$INPUTS,${c}.fa
156 [ -z "$INPUTS" ] && INPUTS=${c}.fa
159 CMD="${BOWTIE_BUILD_EXE} $* ${INPUTS} hg19"
162 echo "hg19 index built; you may remove fasta files"
164 echo "Index building failed; see error message"