4 # Downloads sequence for the mm9 version of M. musculus (mouse) from
7 # Note that UCSC's mm9 build has two categories of compressed fasta
10 # 1. The base files, named chr??.fa.gz
11 # 2. The unplaced-sequence files, named chr??_random.fa.gz
13 # By default, this script builds and index for just the base files,
14 # since alignments to those sequences are the most useful. To change
15 # which categories are built by this script, edit the CHRS_TO_INDEX
58 CHRS_TO_INDEX=$BASE_CHRS
60 UCSC_MM9_BASE=ftp://hgdownload.cse.ucsc.edu/goldenPath/mm9/chromosomes
64 if ! wget --version >/dev/null 2>/dev/null ; then
65 if ! curl --version >/dev/null 2>/dev/null ; then
66 echo "Please install wget or curl somewhere in your PATH"
69 curl -o `basename $1` $1
77 BOWTIE_BUILD_EXE=./bowtie-build
78 if [ ! -x "$BOWTIE_BUILD_EXE" ] ; then
79 if ! which bowtie-build ; then
80 echo "Could not find bowtie-build in current directory or in PATH"
83 BOWTIE_BUILD_EXE=`which bowtie-build`
88 for c in $CHRS_TO_INDEX ; do
89 if [ ! -f ${c}.fa ] ; then
91 get ${UCSC_MM9_BASE}/$F || (echo "Error getting $F" && exit 1)
92 gunzip $F || (echo "Error unzipping $F" && exit 1)
94 [ -n "$INPUTS" ] && INPUTS=$INPUTS,${c}.fa
95 [ -z "$INPUTS" ] && INPUTS=${c}.fa
98 CMD="${BOWTIE_BUILD_EXE} $* ${INPUTS} mm9"
101 echo "mm9 index built; you may remove fasta files"
103 echo "Index building failed; see error message"