-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfigures.sh
executable file
·112 lines (94 loc) · 3.58 KB
/
figures.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
rm -r Particle*particle*
source figure_parameters.src
source ../pipeline.sh
logFILE="../simulation_runs/${currentjob}TASK1.log"
smcsmcVersion=$(grep "smcsmc version" ${logFILE})
scrmVersion=$(grep "scrm version" ${logFILE})
actual_seqlen=()
actual_mutrate=()
actual_recombrate=()
for seqlen_index in "${seqlen_index_array[@]}"; do
actual_seqlen+=(${seqlen_array[seqlen_index]})
actual_mutrate+=(${theta_array[seqlen_index]})
actual_recombrate+=(${rho_array[seqlen_index]})
done
echo ${actual_seqlen[*]} > actual_seqlen_tmp
actual_particles=()
for particle_index in "${particle_index_array[@]}"; do
actual_particles+=(${particle_array[particle_index]})
done
echo ${actual_particles[*]} > actual_particles_tmp
rm -r *_ErrFiles
rm -r *_OutFiles
rm Particle*.sh
python movie.py ${suffix} ${scalingNe} ${model}
echo "
\documentclass[12pt,landscape]{article}
\usepackage[a2paper]{geometry}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{tikz}
%\newcommand{\Iteration}{16}
\begin{document}
{\LARGE \bf
~\\\\
${smcsmcVersion} \\\\
${scrmVersion} \\\\
smcsmc Parameters: \\\\
Data source: ${DATA} \\\\
Time interval pattern: ${pattern_tmax} \\\\
Number of replicates: ${number_of_replicates} \\\\
EM iterations = ${EM} \\\\
Number of particles: $(echo ${actual_particles[*]} | tr ' ' ,) \\\\
Sequence lengths : $(echo ${actual_seqlen[*]} | tr ' ' ,) \\\\
Mutation rates: $(echo ${actual_mutrate[*]} | tr ' ' ,) \\\\
Recombination rates: $(echo ${actual_recombrate[*]} | tr ' ' ,) \\\\
%#Actual sequence used: $(echo ${seqlen_index_array[*]} | tr ' ' ,) \\\\
%#Actual number of particle used: $(echo ${particle_index_array[*]} | tr ' ' ,) \\\\
}
\newpage
{\LARGE \bf Relative deviation in parameter estimation\\\\
From top to bottom, particles are $(echo ${actual_particles[*]} | tr ' ' ,) \\\\
From left to right, sequence lengths are $(echo ${actual_seqlen[*]} | tr ' ' ,)
}
\begin{center}
\foreach \particlenumber in {$(echo ${actual_particles[*]} | tr ' ' ,)} {
\foreach \seqlen in {$(echo ${actual_seqlen[*]} | tr ' ' ,)} {
\includegraphics[width=$(echo " 1/${#seqlen_index_array[@]} -0.05" | bc -l)\textwidth]{Particle\particlenumber Seqlen\seqlen /Particle\particlenumber Seqlen\seqlen _dev.png}
} \\\\
}
\end{center}
\newpage
{\LARGE \bf Recombination rate\\\\
From top to bottom, particles are ${particles} \\\\
From left to right, sequence lengths are ${seqlen}
}
\begin{center}
\foreach \particlenumber in {$(echo ${actual_particles[*]} | tr ' ' ,)} {
\foreach \seqlen in {$(echo ${actual_seqlen[*]} | tr ' ' ,)} {
\includegraphics[width=$(echo " 1/${#seqlen_index_array[@]} -0.05" | bc -l)\textwidth]{Particle\particlenumber Seqlen\seqlen /Particle\particlenumber Seqlen\seqlen RE.png}
} \\\\
}
\end{center}
\foreach \Iteration in ${iteration} {
\newpage
{\LARGE \bf Iteration \Iteration \\\\
From top to bottom, particles are $(echo ${actual_particles[*]} | tr ' ' ,) \\\\
From left to right, sequence lengths are $(echo ${actual_seqlen[*]} | tr ' ' ,)
}
\begin{center}
\foreach \particlenumber in {$(echo ${actual_particles[*]} | tr ' ' ,)} {
\foreach \seqlen in {$(echo ${actual_seqlen[*]} | tr ' ' ,)} {
\includegraphics[width=$(echo " 1/${#seqlen_index_array[@]} -0.05" | bc -l)\textwidth]{Particle\particlenumber Seqlen\seqlen /Particle\particlenumber Seqlen\seqlen step\Iteration.png}
} \\\\
}
\end{center}
}
\end{document}
" > ${figurefile}.tex
pdflatex ${figurefile}.tex
Rarg="--args ${#actual_seqlen[@]} ${actual_seqlen[@]} ${#actual_particles[@]} ${actual_particles[@]} ${suffix}"
echo ${Rarg}
rm run_time.r.Rout
R --slave ${Rarg} < run_time.r > run_time.r.Rout