forked from albertwcheng/albert-bioinformatics-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CPCStepOne.sh
executable file
·42 lines (33 loc) · 1.02 KB
/
CPCStepOne.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
37
38
39
40
41
42
#!/bin/bash
if [ $# -lt 3 ]; then
echo $0 inputSeq outputDir "splits[0=no splitting]"
exit
fi
inputSeq=$1
outputDir=$2
splits=$3
splitsDir=`abspath.py $outputDir/splits`
evidenceDir=`abspath.py $outputDir/evidence`
workingsDir=`abspath.py $outputDir/workings`
mkdir $outputDir
outputDir=`abspath.py $outputDir`
mkdir $splitsDir
mkdir $evidenceDir
mkdir $workingsDir
splitLines=`pyeval.py "$splits*2"`
if [ $splits -le 0 ]; then
echo "no split. just link"
ln $inputSeq $splitsDir
else
echo "spliting sequences into $splitLines by split -l $splitLines $inputSeq $splitsDir/$inputSeq"
split -l $splitLines $inputSeq $splitsDir/$inputSeq
fi
cd $splitsDir
for seq in *; do
echo "copying working dir $workingsDir/$seq"
#cp -R ${CPC_HOME}/working $workingsDir/$seq
mkdir $workingsDir/$seq
mkdir $evidenceDir/$seq
echo "submit job bsub run_predict.sh $seq $outputDir/$seq.resultTab $workingsDir/$seq $evidenceDir/$seq/evidence"
bsub run_predict.sh $seq $outputDir/$seq.resultTab $workingsDir/$seq $evidenceDir/$seq/evidence
done