forked from akahanaton/multiz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snake.myoBra2.hg38.qsub.sh
executable file
·72 lines (65 loc) · 3.8 KB
/
snake.myoBra2.hg38.qsub.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#--------------------------------------------------
# for queryDir in `ls -d batsGenome/[[:lower:]]*[[:upper:]]*`
#--------------------------------------------------
for queryDir in `ls -d batsGenome/myoBra`
do
queryID="`basename $queryDir`2"
queryDone="$queryDone$queryID"
echo $queryDone
genomic=`basename $queryDir/*genomic.fa`
nibQueryDir="$queryDir/$queryID.nib2"
#--------------------------------------------------
# for targetDir in `ls -d batsGenome/[[:lower:]]*[[:upper:]]* ucsc/hg38`
#--------------------------------------------------
for targetDir in `ls -d ucsc/hg38`
do
targetID=`basename $targetDir`
if [ $targetID != "hg38" ]; then
targetID=$targetID"2"
fi
if [[ $queryID == $targetID || $queryDone == *"$targetID"* ]]; then continue; fi
snakeDir="snake.$queryID.$targetID"
if [ -e $snakeDir ]; then
echo $snakeDir
for snake in ./$snakeDir/*.snake
do
queryChr=`basename $snake .snake`
lavQueryDir="$queryDir/$queryID.$targetID.lav"
pslQueryDir="$queryDir/$queryID.$targetID.psl"
chainQueryDir="$queryDir/$queryID.$targetID.chain"
if [[ -e $chainQueryDir/merge/$queryChr.chain ]]; then continue; fi
if [ ! -e $lavQueryDir ]; then mkdir $lavQueryDir; fi
if [ ! -e $pslQueryDir ]; then mkdir $pslQueryDir; fi
if [ ! -e $chainQueryDir ]; then mkdir $chainQueryDir; fi
if [ ! -e $lavQueryDir/$queryChr ]; then mkdir $lavQueryDir/$queryChr; fi
if [ ! -e $pslQueryDir/$queryChr ]; then mkdir $pslQueryDir/$queryChr; fi
if [ ! -e $chainQueryDir/$queryChr ]; then mkdir $chainQueryDir/$queryChr; fi
if [ ! -e $chainQueryDir/merge ]; then mkdir $chainQueryDir/merge; fi
if [ ! -e $chainQueryDir/sort ]; then mkdir $chainQueryDir/sort; fi
#--------------------------------------------------
# snakemake -q -j 800 --cluster "qsub -o /dev/null -j y" -s $snake
# qsub -o /dev/null find $lavQueryDir/$queryChr -delete
# qsub -o /dev/null find $pslQueryDir/$queryChr -delete
# qsub -o /dev/null find $chainQueryDir/$queryChr -delete
# qsub -o /dev/null find ./.snakemake/code_tracking -type f -atime 0.05 -delete
# qsub -o /dev/null find ./.snakemake/input_tracking -type f -atime 0.05 -delete
# qsub -o /dev/null find ./.snakemake/params_tracking -type f -atime 0.05 -delete
# qsub -o /dev/null find ./.snakemake/rule_tracking -type f -atime 0.05 -delete
# qsub -o /dev/null find ./.snakemake/shellcmd_tracking -type f -atime 0.05 -delete
#--------------------------------------------------
snakemake -npq -s $snake > $snakeDir/$queryChr.cmd
echo "find $lavQueryDir/$queryChr -delete" >> $snakeDir/$queryChr.cmd
echo "find $pslQueryDir/$queryChr -delete" >> $snakeDir/$queryChr.cmd
echo "find $chainQueryDir/$queryChr -delete" >> $snakeDir/$queryChr.cmd
#--------------------------------------------------
# echo "qsub -o /dev/null find ./.snakemake/code_tracking -type f -atime 0.05 -delete" >> $snakeDir/$queryChr.cmd
# echo "qsub -o /dev/null find ./.snakemake/input_tracking -type f -atime 0.05 -delete" >> $snakeDir/$queryChr.cmd
# echo "qsub -o /dev/null find ./.snakemake/params_tracking -type f -atime 0.05 -delete" >> $snakeDir/$queryChr.cmd
# echo "qsub -o /dev/null find ./.snakemake/rule_tracking -type f -atime 0.05 -delete" >> $snakeDir/$queryChr.cmd
# echo "qsub -o /dev/null find ./.snakemake/shellcmd_tracking -type f -atime 0.05 -delete" >> $snakeDir/$queryChr.cmd
#--------------------------------------------------
done
fi
done
done