forked from akahanaton/multiz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_genome_mysql_raw.sh
executable file
·72 lines (67 loc) · 3.2 KB
/
prepare_genome_mysql_raw.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
#--------------------------------------------------
# for speDir in `ls -d batsGenome/[[:lower:]]*[[:upper:]]*`
#--------------------------------------------------
for speDir in `ls -d batsGenome/pteAle`
#--------------------------------------------------
# for speDir in `ls -d batsGenome/eidHel`
#--------------------------------------------------
do
echo $speDir
genomic=`basename $speDir/*genomic.fa`
ls $speDir/$genomic
id=`basename $speDir`2
echo $id
#--------------------------------------------------
# if [ $id == "eidHel2" ]; then
# continue
# fi
#--------------------------------------------------
#--------------------------------------------------
# maskDir="$speDir/$genomic.mask"
#--------------------------------------------------
maskDir="$speDir/$id.mask2"
chrDir="$speDir/$id.chrs2"
trfDir="$speDir/$id.trf2"
nibDir="$speDir/$id.nib2"
# link $maskDir/$id.fa.masked $maskDir/$id.fa.out $maskDir/$id.fa
if [ ! -e $chrDir ]; then mkdir $chrDir; fi
if [ ! -e $trfDir ]; then mkdir $trfDir; fi
if [ ! -e $nibDir ]; then mkdir $nibDir; fi
maskedGenomic=`ls $maskDir/$id.fa.masked`
# qsub -N $id -pe smp 16 $HOME/software/src/RepeatMasker/RepeatMasker -pa 16 -s -norna -species mammal -dir $maskDir $fa
if [[ "login-7-1" == `hostname` ]]; then
faSize $maskedGenomic -detailed > $speDir/$id.chrom.sizes
awk -v id=$id '{printf "%s\t%d\t/synology/gbdb/%s/%s.2bit\n", $1, $2, id, id}' $speDir/$id.chrom.sizes > $speDir/$id.chromInfo.tab
hgFakeAgp -minContigGap=1 $maskedGenomic $speDir/$id.fake.agp
#--------------------------------------------------
# faSplit byName $maskedGenomic $chrDir/
#--------------------------------------------------
#--------------------------------------------------
# faToTwoBit $maskedGenomic $speDir/$id.2bit
#--------------------------------------------------
# faToTwoBit $maskDir/$id.fa $speDir/$id.2bit
#--------------------------------------------------
#--------------------------------------------------
# for i in `find $chrDir -name "*.fa"`
# do
# curChr=`basename $i .fa`
# trfBig -bedAt=$trfDir/$curChr.bed -tempDir=$trfDir $i $trfDir/$curChr.fa
# faToNib $trfDir/$curChr.fa $nibDir/$curChr.nib
# done
#--------------------------------------------------
find $trfDir/ -name "*.bed" | xargs cat > $speDir/$id.simplerepeat.bed
fi
# run on gentoo
if [[ "gentoo" == `hostname` ]]; then
hgFakeAgp -minContigGap=1 $maskedGenomic $speDir/$id.fake.agp
mkdir /synology/gbdb/$id
mkdir /synology/gbdb/$id/html
faToTwoBit $maskDir/$id.fa /synology/gbdb/$id/$id.2bit
hgsql -e "create database $id;"
hgsql $id < /home/gmswenm/software/src/kentUtils/src/hg/lib/grp.sql
hgLoadSqlTab $id chromInfo $HOME/software/src/kentUtils/src/hg/lib/chromInfo.sql $speDir/$id.chromInfo.tab
hgGoldGapGl $id $speDir/$id.fake.agp
hgLoadBed $id simpleRepeat $speDir/$id.simplerepeat.bed -sqlTable=./kentUtils/src/hg/lib/simpleRepeat.sql
hgLoadOut $id $maskDir/$id.fa.out
fi
done