Commit c8f504b3 authored by Samuel  HANOT's avatar Samuel HANOT

Enable reading a sequence of number of gaussians from a file using -n file_name

parent 3d3dbe70
......@@ -26,7 +26,7 @@ ${SRC_DIR}/recursive_gmconvert.sh -f map_filename -t threshold -n num_gaussians
`-t threshold`: the density threshold
`-n num_gaussians`: number of gaussians per sub-process
`-n num_gaussians_or_file`: If the argument is a number, then number of gaussians per sub-process, if argment is a file then read a sequence of number of gaussians from file
`-0 num_gaussians0`: number of gaussians for first iteration
......@@ -57,18 +57,9 @@ Example 2: `get_maps.sh -n 2 -N 2 -s < input.txt`
In example 2, `input.txt` contains one emdb entry per line.
### Required arguments:
`-n num_gaussians`: number of gaussians per sub-process
`-N num_iterations`: number of recursion levels
### Optional arguments:
`-s`: enable serial mode
`-h`: display this message
### Arguments:
All arguments from `recursive_gmconvert.sh`, except `-f` and `-t`
## References
......
......@@ -6,7 +6,7 @@ usage() {
Required arguments:
-f map_filename: the file name of the input EM map
-t threshold: the density threshold
-n num_gaussians: number of gaussians per sub-process
-n num_gaussians: number of gaussians per sub-process. Alternatively pass a file which contains a sequence of number of gaussians
-0 num_gaussians0: number of gaussians for first iteration
-N num_iterations: number of recursion levels
Optional arguments:
......@@ -24,6 +24,13 @@ N=
i0=1
serial=0
MaxArraySize=100000
get_max_jobs(){
echo ${MaxArraySize}
}
profile_cmd="time"
while getopts f:t:n:N:i:0:sh opt
do
case "$opt" in
......@@ -44,34 +51,44 @@ do
done
#check that necessary options were set
if [[ ! -e "$map_name" ]] || [[ -z "$threshold" ]] || [[ -z "$ng" ]] || [[ -z "$N" ]]
if [[ ! -f "$map_name" ]] || [[ -z "$threshold" ]] || [[ -z "$ng" ]]
then
usage
exit 1
fi
if [[ -z "$ng0" ]]
then
ng0=$ng
fi
num_gaussians=()
for ((i=$i0 ; i<=N ; i++))
do
if ((i==1))
if [[ -f "$ng" ]]
then
# ng is a file that contains a list of number of gaussians
while read n
do
num_gaussians+=$n
done < $ng
else
# ng is a number and then N needs to be set
if [[ -z "$N" ]]
then
num_gaussians+=$ng0
usage
exit 1
else
num_gaussians+=$ng
fi
done
if [[ -z "$ng0" ]]
then
ng0=$ng
fi
for ((i=$i0 ; i<=N ; i++))
do
if ((i==1))
then
num_gaussians+=$ng0
else
num_gaussians+=$ng
fi
done
fi
fi
MaxArraySize=100000
get_max_jobs(){
echo ${MaxArraySize}
}
profile_cmd="time"
bindir=${0:h}
impdir=~/imp-fast/
......@@ -86,7 +103,9 @@ cd $map_root_dir
mkdir -p converged
for ((i=$i0 ; i<=${#num_gaussians} ; i++))
do
n=${num_gaussians[$i]}
n=$i
ng=${num_gaussians[$i]}
echo "i=$i n=$n ng=$ng"
jobname=${map_name}_${n}
n_jobs=1
......@@ -96,7 +115,7 @@ do
then
${gmconvert} -imap ${map_name} -zth ${threshold} -oimap threshold.map -ogmm /dev/null -ng 0
fi
echo ${profile_cmd} ${gmconvert} -imap ${map_name} -ogmm $n/${n}_0.gmm -ng ${ng0} -zth ${threshold}
echo ${profile_cmd} ${gmconvert} -imap ${map_name} -ogmm $n/${n}_0.gmm -ng ${ng} -zth ${threshold}
echo ${gmconvert} -igmm $n/${n}_0.gmm -imap ${map_name} -omap /dev/null
else
n_prev=$((i-1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment