Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. path=$1
  4. threshold=$2
  5.  
  6. if [ ! $path ];then
  7. path='.'
  8. fi
  9. if [ ! $threshold ];then
  10. threshold=10
  11. fi
  12. echo Threshold: $threshold
  13.  
  14. if [ -f sample.lt.$threshold ];then
  15. rm -f sample.lt.$threshold
  16. fi
  17.  
  18. for sample in `ls $path | grep -v sample`;do
  19. total=`cat $path/$sample/*stat | grep total_reads | awk 'BEGIN{sum=0} {sum+=$NF} END{print sum*150/1e9}'`
  20. if [ ${total%.*} -lt $threshold ];then
  21. echo -e "\e[0;35m$sample\t$total\e[0m"
  22. echo -e "$sample\t$total" >> sample.lt.$threshold
  23. else
  24. echo -e "$sample\t$total"
  25. fi
  26. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement