limit fstBC to 30bp in Python3 ver.
[GalaxyCodeBases.git] / tools / etc / checkbam.sh
blobd210d62a1f77b5fe9e83436bdd9dac49f2a23e48
1 #!/bin/bash
3 if [ x"$1" = x"" ]; then
4 echo "Usage: $0 <outfile> [find_path(.)]"
5 exit
6 fi
8 if [ x"$2" = x"" ]; then
9 TOFIND="."
10 else
11 TOFIND="$2"
13 TOFIND=`readlink -nf ${TOFIND}`
15 date > $1
16 echo "From [${TOFIND}] to [$1]:"
17 echo "Find in [${TOFIND}]" >> $1
19 find -L ${TOFIND} -name '*.bam' | while read a;
20 do echo -n "Checking [$a] ...";
21 RES=`gzip -t "$a" 2>&1`;
22 RETVAL=$?;
23 if [ "${RETVAL}" -ne "0" ]; then
24 echo -e "\b\b\b\b:Error=${RETVAL}.${RES}"
25 echo "[e${RETVAL}] ${a}${RES}" >> $1
26 else
27 echo -e "\b\b\b\b:OK."
28 echo "[ok] ${a}" >> $1
29 fi;
30 done