forked from quwubin/MFEprimer-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexDb.sh
executable file
·57 lines (43 loc) · 994 Bytes
/
IndexDb.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
#!/bin/bash
# Index database for MFEprimer-2.0
# Wubin Qu <[email protected]>
if [[ $OSTYPE == linux-gnu ]]
then
MFEHOME=$(dirname $(readlink -f "$0"))
else
MFEHOME=$(dirname $(which ${0}))
fi
if [ $# == 2 ]
then
fasta_file=$1
k=$2
elif [ $# == 1 ]
then
fasta_file=$1
k=9
else
echo Usage:
echo
echo $(basename $0) Fasta_file K_value
echo
echo Example:
echo
echo $(basename $0) Human.fasta 9
echo
exit
fi
echo "Begin indexing ..."
$MFEHOME/chilli/UniFastaFormat.py -i $fasta_file
echo "Step 1/3: UniFasta done."
if [ `getconf LONG_BIT` == 64 ]
then
$MFEHOME/bin/64bit/faToTwoBit $fasta_file.unifasta $fasta_file.2bit
else
$MFEHOME/bin/32bit/faToTwoBit $fasta_file.unifasta $fasta_file.2bit
fi
echo "Step 2/3: faToTwoBit done."
echo "Step 3/3: Index begin ..."
$MFEHOME/chilli/mfe_index_db.py -f $fasta_file.unifasta -k $k
chmod 777 $fasta_file.uni
echo "Step 3/3: Index done"
rm $fasta_file.unifasta