-
Notifications
You must be signed in to change notification settings - Fork 0
/
runGOall.sh
36 lines (31 loc) · 718 Bytes
/
runGOall.sh
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
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: ./runGOall.sh
1) /PATH/TO/BED_DIR
2) /PATH/TO/INPUT_OUTPUT_DIR/ "
exit 1
fi
#Inputting arguments
BED_DIR=$1
OUT_DIR=$2
echo "Searching ${DIR}"
for FILE in ${DIR}/*.bed
do
echo "Getting Gene List CSV"
python bed_to_geneListcsv.py -f $FILE -s $OUT_DIR
#Getting DIR name
savedir="${FILE%.*}"
IFS='/' read -r -a array <<< $savedir
actualdir="${array[-1]}"
echo $actualdir
# BASEDIR="$(dirname $FILE)"
#echo $BASEDIR
# med="/test_results/clusters/"
# godir="$BASEDIR$med$actualdir/"
#echo $godir
godir="$OUT_DIR$actualdir"
echo $godir
echo "Running GO Analysis the Gene List"
Rscript clusterProfiler.r $godir $actualdir 0 dme 0.05
done
echo "Done!"