GIGI_2_split.sh 1.35 KB
Newer Older
1 2
#!/bin/bash

3
export timecmd="$(which time)"
4 5 6 7 8 9 10
if [ ${verbose} ]
then
  echo
  echo "INPUT FOLDER: " "${input_folder}"
fi
mkdir -p "${output_folder}/${run_name}/LOGS"
echo "Logs in: " "${output_folder}/${run_name}/LOGS"
11
cd ${input_folder}
12 13 14 15
if [ ${verbose} ]
then
  find "${gigi_split_prefix%/*}" -name "chunk_0*"
fi
16 17 18 19
if [[ -n $(find "${gigi_split_prefix%/*}" -name "chunk_0*") ]]
then
  echo "chunk_0.geno exists, file is most likely already split, if it is not, then remove the existing chunks from ${gigi_split_prefix%/*} and try again"
else
20
  mkdir -p "${output_folder}/${run_name}/STATS"
21 22 23 24
  if [ ${verbose} ]
  then
    echo "Long is: " "${long}"
  fi
25
  echo "SPLIT STEP, NUM CHUNKS: " "${num_chunks}"
Khalid Kunji's avatar
Khalid Kunji committed
26 27 28 29 30 31
  if [[ "${region_start}" && "${region_end}" ]]
  then
    $timecmd -o "${output_folder}/${run_name}/STATS/time${i}.log" -f'memory in kilobytes %M real %e user %U sys %S command %C' "${gigi_split}" "${param_file##*/}" "${num_chunks}" "${gigi_split_prefix}" "${long}" "${region_start}" "${region_end}"> "${output_folder}/${run_name}/LOGS/split.log"
  else
    $timecmd -o "${output_folder}/${run_name}/STATS/time${i}.log" -f'memory in kilobytes %M real %e user %U sys %S command %C' "${gigi_split}" "${param_file##*/}" "${num_chunks}" "${gigi_split_prefix}" "${long}" > "${output_folder}/${run_name}/LOGS/split.log"
  fi
32
  echo "Split exit status: " "$?"
33 34 35 36
fi
cd "$parent_path"
echo
echo