4 # Downloads sequence for the galGal3 version of G. gallus (chicken)
11 while [ $i -lt 25 ] ; do
12 BASE_CHRS="$BASE_CHRS chr$i"
16 BASE_CHRS="$BASE_CHRS chr26 chr27 chr28 chr32"
18 BASE_CHRS="$BASE_CHRS chrW chrZ"
20 BASE_CHRS="$BASE_CHRS chrM"
21 # Add other unplaced, but autosome-associated
22 BASE_CHRS="$BASE_CHRS chr1_random chr2_random chr4_random chr5_random chr6_random chr7_random chr8_random chr10_random chr11_random chr12_random chr13_random chr16_random chr17_random chr18_random chr20_random chr22_random chr25_random chr28_random"
23 # Add other unplaced, but sex-chromosome-associated
24 BASE_CHRS="$BASE_CHRS chrW_random chrZ_random"
25 # Add totally unplaced
26 BASE_CHRS="$BASE_CHRS chrUn_random"
28 CHRS_TO_INDEX=$BASE_CHRS
30 FTP_BASE=ftp://hgdownload.cse.ucsc.edu/goldenPath/galGal3/chromosomes
34 if ! wget --version >/dev/null 2>/dev/null ; then
35 if ! curl --version >/dev/null 2>/dev/null ; then
36 echo "Please install wget or curl somewhere in your PATH"
39 curl -o `basename $1` $1
47 BOWTIE_BUILD_EXE=./bowtie-build
48 if [ ! -x "$BOWTIE_BUILD_EXE" ] ; then
49 if ! which bowtie-build ; then
50 echo "Could not find bowtie-build in current directory or in PATH"
53 BOWTIE_BUILD_EXE=`which bowtie-build`
58 for c in $CHRS_TO_INDEX ; do
59 if [ ! -f ${c}.fa ] ; then
61 get ${FTP_BASE}/$F || (echo "Error getting $F" && exit 1)
62 gunzip $F || (echo "Error unzipping $F" && exit 1)
64 [ -n "$INPUTS" ] && INPUTS=$INPUTS,${c}.fa
65 [ -z "$INPUTS" ] && INPUTS=${c}.fa
68 CMD="${BOWTIE_BUILD_EXE} $* ${INPUTS} galGal3"
71 echo "galGal3 index built; you may remove fasta files"
73 echo "Index building failed; see error message"