Commit patch to not break on spaces.
[bowtie.git] / scripts / make_s_cerevisiae.sh
1 #!/bin/sh
2
3 #
4 # Downloads sequence for a S. cerevisiae from CYGD.  This script
5 # was used to build the Bowtie index for S. cerevisiae.
6 #
7
8 GENOMES_MIRROR=ftp://ftpmips.gsf.de/yeast/sequences 
9
10 BOWTIE_BUILD_EXE=./bowtie-build
11 if [ ! -x "$BOWTIE_BUILD_EXE" ] ; then
12         if ! which bowtie-build ; then
13                 echo "Could not find bowtie-build in current directory or in PATH"
14                 exit 1
15         else
16                 BOWTIE_BUILD_EXE=`which bowtie-build`
17         fi
18 fi
19
20 if [ ! -f Scerevisiae_chr.fna ] ; then
21         if ! which wget > /dev/null ; then
22                 echo wget not found, looking for curl...
23                 if ! which curl > /dev/null ; then
24                         echo curl not found either, aborting...
25                 else
26                         # Use curl
27                         curl ${GENOMES_MIRROR}/Scerevisiae_chr -o Scerevisiae_chr.fna
28                 fi
29         else
30                 # Use wget
31                 wget ${GENOMES_MIRROR}/Scerevisiae_chr
32                 mv Scerevisiae_chr Scerevisiae_chr.fna
33         fi
34 fi
35
36 if [ ! -f Scerevisiae_chr.fna ] ; then
37         echo "Could not find Scerevisiae_chr.fna file!"
38         exit 2
39 fi
40
41 CMD="$BOWTIE_BUILD_EXE $* Scerevisiae_chr.fna s_cerevisiae"
42 echo $CMD
43 if $CMD ; then
44         echo "s_cerevisiae index built; you may remove fasta files"
45 else
46         echo "Index building failed; see error message"
47 fi