-
Notifications
You must be signed in to change notification settings - Fork 2
/
set_zci_env
45 lines (35 loc) · 1.07 KB
/
set_zci_env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Set main ZCI directory
ZCI_MAIN_DIR=/home/ZCI
ZCITOOLS=$ZCI_MAIN_DIR/zcitools/zcitools
ZCI_PROGRAM_PATHS=`$ZCITOOLS/bin/find_paths.py $ZCI_MAIN_DIR/programs -s`
export PATH=$ZCITOOLS/bin:$ZCI_PROGRAM_PATHS:$PATH
export PYTHONPATH=$ZCITOOLS:$PYTHONPATH
# Used by zcit.py commands
export ZCI_COMMON_DB=$ZCI_MAIN_DIR/caches/_common_db_
# Set our seqrunces paths
export ZCI_OUR_SEQUENCES=$ZCI_MAIN_DIR/data/assemblies
# Other needed env vars
export BT2_HOME=$ZCI_MAIN_DIR/programs/alignment/Bowtie2/current/bin
# Picard
export PICARD=$ZCI_MAIN_DIR/programs/tools/Picard/picard.jar
# Autocomplete
_zcit()
{
local cur opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
# Filename for next arguments
if [ "${#COMP_WORDS[@]}" != "2" ]; then
if [ "${cur}" != "" ]; then
opts=$(ls . | grep ${cur})
else
opts=$(ls .)
fi
else
opts=$(${DOKTORAT_SOURCE}/bin/zcit.py list_commands | grep -v "Warning: module")
fi
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _zcit zcit.py