1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#!/bin/bash
set -ex
pkg=stringtie
CUR_DIR=`pwd`
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi
cp ${CUR_DIR}/debian-tests-data/* -a "${AUTOPKGTEST_TMP}"
cd "${AUTOPKGTEST_TMP}"
gunzip -r *
# XXX: update from upstream's run_tests.sh after that point. Note you
# also need to invoke stringtie without relative path; there is also a
# broken increment caught as a non-zero error code.
arrins=("short_reads" "short_reads_and_superreads" "mix_short" "long_reads" \
"long_reads" "mix_short mix_long" "mix_short mix_long" "mix_short" "mix_short")
arrparms=("" "" "-G mix_guides.gff" "-L" "-L -G human-chr19_P.gff" "--mix" "--mix -G mix_guides.gff" \
"-N -G mix_guides.gff" "--nasc -G mix_guides.gff")
arrout=("short_reads" "short_reads_and_superreads" "short_guided" "long_reads" \
"long_reads_guided" "mix_reads" "mix_reads_guided" "mix_short_N_guided" "mix_short_nasc_guided")
arrmsg=("Short reads" "Short reads and super-reads" "Short reads with annotation guides" "Long reads" \
"Long reads with annotation guides" "Mixed reads" "Mixed reads with annotation guides" \
"Short reads with -N" "Short reads with --nasc")
for i in ${!arrmsg[@]}; do
fout="${arrout[$i]}.out.gtf"
/bin/rm -f $fout
fcmp="${arrout[$i]}.out_expected.gtf"
if [ ! -f $fcmp ]; then
echo "Error: file $fcmp does not exist! Re-download test data."
exit 1
fi
n=$i
n=$((n+1))
echo "Test ${n}: ${arrmsg[$i]}"
fin=${arrins[$i]}.bam
if [[ ${arrins[$i]} =~ ^mix ]]; then
ins=( ${arrins[$i]} )
if [[ ${#ins[@]} -gt 1 ]]; then
fin="${ins[0]}.bam ${ins[1]}.bam"
fi
fi
echo "Running: ../stringtie ${arrparms[$i]} -o $fout $fin"
stringtie ${arrparms[$i]} -o $fout $fin
if [ ! -f $fout ]; then
echo "Error: file $fout not created! Failed running stringtie on $fin"
exit 1
fi
if diff -q -I '^#' $fout $fcmp &>/dev/null; then
echo " OK."
else
echo "Error: test failed, output $fout different than expected ($fcmp)!"
#exit 1
fi
done
|