-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathpore_model.sh
executable file
·56 lines (47 loc) · 1.39 KB
/
pore_model.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
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: ./pore_model.sh <input_genomic_sequence> <context_or_kmer> "
echo "[note]: context_or_kmer: 0 for context-dependent pore_model "
echo " 1 for kmer official pore_model "
exit
fi
#------ read input arguments ---------#
FULLFILE=$1
CONTEXT=$2
PREFIX=signal
THREAD_NUM=1
REPEAT_LEN=1
MODEL_FILE=template_median68pA.model
TEMPLATE_FILE=template.fast5
home=`pwd`
#----- get input name ---#
fulnam=`basename $FULLFILE`
relnam=${fulnam%.*}
#----- create tmp_dir ---#
DATE=`date '+%Y_%m_%d_%H_%M_%S'`
tmp_root="/tmp/PORE_MODEL_${relnam}_${RANDOM}_${DATE}"
mkdir -p $tmp_root
#------ choose different pore model ----#
if [ $CONTEXT -eq 0 ]
then
#-> context-dependent pore model
source activate tensorflow_cdpm
export DeepSimulatorHome=$home
python2 $home/pore_model/src/context_simulator.py \
-i $FULLFILE -p $PREFIX -l $PREFIX -t $THREAD_NUM \
-F $tmp_root -T $home/util/$TEMPLATE_FILE \
--sigout True --perfect True --perflen $REPEAT_LEN
source deactivate
else
#-> official kmer pore model
source activate tensorflow_cdpm
python2 $home/pore_model/src/kmer_simulator.py \
-i $FULLFILE -p $PREFIX -l $PREFIX -t $THREAD_NUM \
-F $tmp_root -T $home/util/$TEMPLATE_FILE \
-m $home/pore_model/model/$MODEL_FILE \
--sigout True --perfect True --perflen $REPEAT_LEN
source deactivate
fi
#---- remove tmp_dir ---#
rm -rf $tmp_root