| 1 | #!/bin/sh |
| 2 | |
| 3 | base_dir=$(dirname $0) |
| 4 | |
| 5 | if [ 1 != $# -a 2 != $# ]; then |
| 6 | echo "usage: $0 db_path [gene.txt_path]" |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | if [ -z $2 ]; then |
| 11 | dictionary_dir=gene95-dictionary |
| 12 | gene_txt=${dictionary_dir}/gene.txt |
| 13 | if [ ! -f $gene_txt ]; then |
| 14 | gene95_tar_gz=gene95.tar.gz |
| 15 | wget -O $gene95_tar_gz \ |
| 16 | http://www.namazu.org/~tsuchiya/sdic/data/gene95.tar.gz |
| 17 | mkdir -p ${dictionary_dir} |
| 18 | tar xvzf ${gene95_tar_gz} -C ${dictionary_dir} |
| 19 | fi |
| 20 | else |
| 21 | gene_txt=$2 |
| 22 | fi |
| 23 | |
| 24 | if cat $gene_txt | ${base_dir}/gene2grn.rb | groonga $1 > /dev/null; then |
| 25 | echo "gene95 data loaded." |
| 26 | fi |