/tools/human_genome_variation/ldtools_wrapper.sh

https://bitbucket.org/cistrome/cistrome-harvard/ · Shell · 64 lines · 45 code · 10 blank · 9 comment · 3 complexity · 237e0dc5b05790d7fe3f403b88da395a MD5 · raw file

  1. #!/usr/bin/env bash
  2. #
  3. # Galaxy wrapper for Aakrosh Ratan's ldtools
  4. #
  5. set -e
  6. export PATH=$PATH:$(dirname $0)
  7. ## pagetag options
  8. input=
  9. rsquare=0.64
  10. freq=0.00
  11. sample=###
  12. ## senatag options
  13. excluded=###
  14. required=###
  15. output=
  16. until [ $# -eq 0 ]
  17. do
  18. case $1 in
  19. rsquare=*)
  20. rsquare=${1#rsquare=}
  21. ;;
  22. freq=*)
  23. freq=${1#freq=}
  24. ;;
  25. input=*)
  26. input=${1#input=}
  27. ;;
  28. output=*)
  29. output=${1#output=}
  30. ;;
  31. *)
  32. if [ -z "$new_args" ]; then
  33. new_args=$1
  34. else
  35. new_args="$new_args $1"
  36. fi
  37. ;;
  38. esac
  39. shift
  40. done
  41. ## run pagetag
  42. pagetag.py --rsquare $rsquare --freq $freq $input snps.txt neighborhood.txt &> /dev/null
  43. if [ $? -ne 0 ]; then
  44. echo "failed: pagetag.py --rsquare $rsquare --freq $freq $input snps.txt neighborhood.txt"
  45. exit 1
  46. fi
  47. ## run sentag
  48. senatag.py neighborhood.txt snps.txt > $output 2> /dev/null
  49. if [ $? -ne 0 ]; then
  50. echo "failed: senatag.py neighborhood.txt snps.txt"
  51. exit 1
  52. fi
  53. ## cleanup
  54. rm -f snps.txt neighborhood.txt