-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_rtfbsdb.bsh
38 lines (29 loc) · 1.16 KB
/
run_rtfbsdb.bsh
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
#!/usr/bin/bash
if [ "$#" -lt 4 ]; then
echo ""
echo "USAGE: bash run_rtfbsdb.bsh species cisbp_zip genome_id genome_2bit TFBS_output_dir [cpu_cores]"
echo ""
echo "genome_id -- Genome id, such as hg19, mm10"
echo "cisbp_zip -- The zip file including motif list and PWM files. (downloaded from cis-bp)."
echo "genome_2bit -- The 2 bit file of genome, e.g. hg19.2bit"
echo "TFBS_output_dir -- The path to output the TFBS bed files for each motif define in cisbp_zip"
echo "[cpu_cores] -- [optional, default=8] indicating how many CPU cores can be used."
echo ""
exit 1
fi
pushd `dirname $0` > /dev/null
bsh_path=`pwd`
popd > /dev/null
genome_id=$1
cisbp=$2
genome_file=$3
output_dir=$4
cpucores=8
if [ "$#" -gt 4 ]; then
# [[ $6 !~ ^?[0-9]+$ ]]
cpucores=$5
fi
echo "Using: R --vanilla --slave --args $genome_id $cisbp $genome_file $output_dir $cpucores < $bsh_path/Rscript/run-rtfbsdb.R"
R --vanilla --slave --args $bsh_path $genome_id $cisbp $genome_file $output_dir $cpucores < $bsh_path/Rscript/run-rtfbsdb.R
mkdir -p $output_dir/tfbs_ext
bash parallel_tfbs_ext.bsh $output_dir $output_dir/tfbs_ext $cpucores