heatmap_main.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #$ -cwd
  2. #$ -A weizhe.li
  3. #$ -l h_rt=001:00:00
  4. #$ -S /bin/sh
  5. #$ -j y
  6. #$ -o sysout_heatmap
  7. #$ -N heatmap_main
  8. echo "Running job $JOB_ID on $HOSTNAME"
  9. QSUB=/opt/sge_root/bin/lx-amd64/qsub
  10. ARRAY_SCRIPT=heatmap_ar.sh
  11. declare -A dimensions
  12. dimensions[normal]="/home/weizhe.li/li-code4hpc/pred_dim_0314/training-updated/normal/dimensions"
  13. dimensions[tumor]="/home/weizhe.li/li-code4hpc/pred_dim_0314/training-updated/tumor/dimensions"
  14. dimensions[test]="/home/weizhe.li/li-code4hpc/pred_dim_0314/testing/dimensions"
  15. declare -A index_paths
  16. index_paths[normal]="/home/weizhe.li/li-code4hpc/pred_dim_0314/training-updated/normal/patch_index"
  17. index_paths[tumor]="/home/weizhe.li/li-code4hpc/pred_dim_0314/training-updated/tumor/patch_index"
  18. index_paths[test]="/home/weizhe.li/li-code4hpc/pred_dim_0314/testing/patch_index"
  19. slide_category=$1 # expects normal, tumor or test
  20. Folder_dimension=${dimensions[$slide_category]}
  21. slide_path=${slide_paths[$slide_category]}
  22. index_path=${index_paths[$slide_category]}
  23. Folder_Prediction_Results=$2
  24. # expect like this: "/scratch/mikem/UserSupport/weizhe.li/runs_process_cn_True/normal_wnorm_448_400_7690666"
  25. listfile="$slide_category"_preds_list
  26. ls -1 "$Folder_Prediction_Results" | grep $slide_category > $listfile
  27. num=`ls -1 "$Folder_Prediction_Results" | grep $slide_category | wc -l`
  28. SYSOUT_DIR="$Folder_Prediction_Results"/heatmap_sysout
  29. mkdir -p $SYSOUT_DIR
  30. # test
  31. # num=2
  32. ARRAY_SCRIPT=heatmap_arr.sh
  33. $QSUB -pe thread 1 -t 1-"$num" -o $SYSOUT_DIR $ARRAY_SCRIPT $listfile $Folder_Prediction_Results $Folder_dimension $index_path