-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmoveFiles.sh
executable file
·62 lines (58 loc) · 2.36 KB
/
moveFiles.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
#!/bin/bash
phenotype=$1
contBin=$2
covars=$3
numperm=$4
echo "Phenotype: ${phenotype}"
echo "Type: ${contBin}"
echo "Covars: ${covars}"
echo "Num perm: ${numperm}"
if [ $covars = "0" ]
then
mkdir -p gsea/${contBin}/gsea_${phenotype}_nocovar/perm
mkdir -p gsea/${contBin}/gsea_${phenotype}_nocovar/obs
mkdir -p gsea/${contBin}/gsea_${phenotype}_nocovar/genes
else
mkdir -p gsea/${contBin}/gsea_${phenotype}_covars${3}/perm
mkdir -p gsea/${contBin}/gsea_${phenotype}_covars${3}/obs
mkdir -p gsea/${contBin}/gsea_${phenotype}_covars${3}/genes
fi
for (( i=0; i<=$numperm; i++ ))
do
if [ $i -eq 0 ]
then
if [ $covars = "0" ]
then
mv Gsea-${phenotype}_${contBin}-nocovar_${i}/*gsea.txt gsea/${contBin}/gsea_${phenotype}_nocovar/obs
mv Gsea-${phenotype}_${contBin}-nocovar_${i}/*genes.txt gsea/${contBin}/gsea_${phenotype}_nocovar/genes
else
mv Gsea-${phenotype}_${contBin}-covars${covars}_${i}/*gsea.txt gsea/${contBin}/gsea_${phenotype}_covars${3}/obs
mv Gsea-${phenotype}_${contBin}-covars${covars}_${i}/*genes.txt gsea/${contBin}/gsea_${phenotype}_covars${3}/genes
fi
else
if [ $covars = "0" ]
then
mv Gsea-${phenotype}_${contBin}-nocovar_${i}/*gsea.txt gsea/${contBin}/gsea_${phenotype}_nocovar/perm
mv Gsea-${phenotype}_${contBin}-nocovar_${i}/*genes.txt gsea/${contBin}/gsea_${phenotype}_nocovar/genes
else
mv Gsea-${phenotype}_${contBin}-covars${covars}_${i}/*gsea.txt gsea/${contBin}/gsea_${phenotype}_covars${3}/perm
mv Gsea-${phenotype}_${contBin}-covars${covars}_${i}/*genes.txt gsea/${contBin}/gsea_${phenotype}_covars${3}/genes
fi
fi
done
if [ $covars = "0" ]
then
v=$(ls gsea/${contBin}/gsea_${phenotype}_nocovar/obs/*.txt | wc -l)
echo "Num files in obs: " ${v}
v=$(ls gsea/${contBin}/gsea_${phenotype}_nocovar/perm/*.txt | wc -l)
echo "Num files in perm: " ${v}
v=$(ls gsea/${contBin}/gsea_${phenotype}_nocovar/genes/*.txt | wc -l)
echo "Num files in genes: " ${v}
else
v=$(ls gsea/${contBin}/gsea_${phenotype}_covars${3}/obs/*.txt | wc -l)
echo "Num files in obs: " ${v}
v=$(ls gsea/${contBin}/gsea_${phenotype}_covars${3}/perm/*.txt | wc -l)
echo "Num files in perm: " ${v}
v=$(ls gsea/${contBin}/gsea_${phenotype}_covars${3}/genes/*.txt | wc -l)
echo "Num files in genes: " ${v}
fi