-
Notifications
You must be signed in to change notification settings - Fork 3
/
EAsplit
executable file
·29 lines (25 loc) · 1.1 KB
/
EAsplit
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
#!/usr/bin/env bash
# sva::ComBat_seq is not available in R/3.5.1
if [[ -n "$1" ]]; then
src="$(dirname $0)/src"
if [[ ! -f "$src/.env" ]]; then
echo "EAsplit: Please run ./install to setup necessary env variables"
exit
fi
source $src/.env;eval $condaEnv
if [[ ! -f "$HOME/.gitconfig" ]] || [[ $(grep "$(dirname $0)/.git" ~/.gitconfig | wc -l) == 0 ]];then #
git config --global --add safe.directory $(dirname $0)/.git
fi
env -i src="$src" a=$1 b=$2 c=$3 bash -c 'set -o allexport;source $src/.env;set +o allexport;eval $condaEnv;Rscript $src/prjSplit.R $src/ $a $b $c'
#condaEnv=$(head -n 1 $(dirname $0)/src/sys.yml)
#condaEnv=${condaEnv:1}
#eval "$condaEnv"
#Rscript $(dirname $0)/src/prjSplit.R $(dirname $0)/src/ $@
else
echo "=============== EAsplit path/to/config/file"
exePath=$(dirname $0)
echo "An example config file can be found: $exePath/example/config.yml"
echo "'EAsplit' can be used to split a project into sub projects based on one meta column definition (split_meta in config)."
echo "==============="
exit 0
fi