Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hasindu2008 committed Feb 17, 2024
1 parent f864294 commit 73df18a
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 39 deletions.
2 changes: 2 additions & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ test/
ecoli_2kb_region/reads.blow5.idx
ecoli_2kb_region_vbz/
rna-spliced/
uhr_rna004_1k/
hg2_lsk114_reads_1000/
36 changes: 21 additions & 15 deletions test/test_eventalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ else
fi
# execution mode (valgrind/gdb/cpu/cuda/echo)
mode=
testset_url="https://f5c.page.link/f5c_ecoli_2kb_region_test"
fallback_url="https://f5c.page.link/f5c_ecoli_2kb_region_test_fallback"
testset_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_test"
fallback_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_test_fallback"


#############################################################################################
Expand All @@ -49,7 +49,7 @@ download_test_set() {
download_ecoli_2kb_region_big_testresults() {
mkdir -p test
tar_path=test/data.tgz
wget -O $tar_path "https://f5c.page.link/f5c_ecoli_2kb_region_big_testresults" || rm -rf $tar_path ${testdir}_big_testresults
wget -O $tar_path "https://f5c.bioinf.science/f5c_ecoli_2kb_region_big_testresults" || rm -rf $tar_path ${testdir}_big_testresults
echo "Extracting. Please wait."
tar -xf $tar_path -C test || rm -rf $tar_path ${testdir}_big_testresults
rm -f $tar_path
Expand Down Expand Up @@ -136,13 +136,14 @@ mode_test() {

help_msg() {
echo "Test script for f5c."
echo "Usage: f5c_dir/script/test_eventalign.sh [-c/-e] [-b bam file] [-g reference genome] [-r fastq/fasta read] mode"
echo "Usage: f5c_dir/script/test_eventalign.sh [-c/-e/-f/-z] [-b bam file] [-g reference genome] [-r fastq/fasta read] mode"
echo
echo "mode one of: valgrind/gdb/cpu/cuda/echo"
echo
echo "-c Uses chr22_meth_example test set."
echo "-e Uses rna test set."
echo "-f Uses hg2 datase."
echo "-f Uses hg2 dna r10 test set."
echo "-z Uses uhr rna004 test set."
echo "-b [bam file] Same as f5c -b."
echo "-K [n] Same as f5c -K."
echo "-B [n] Same as f5c -B."
Expand All @@ -155,7 +156,7 @@ help_msg() {

#############################################################################################
# parse options and change defaults if necessary
while getopts b:g:r:t:K:B:cdhef opt
while getopts b:g:r:t:K:B:cdhefz opt
do
case $opt in
b) bamfile="$OPTARG";;
Expand All @@ -166,27 +167,32 @@ do
bamfile=${testdir}/reads.sorted.bam
ref=${testdir}/humangenome.fa
reads=${testdir}/reads.fastq
testset_url="https://f5c.page.link/f5c_na12878_test"
fallback_url="https://f5c.page.link/f5c_na12878_test_fallback";;
testset_url="https://f5c.bioinf.science/f5c_na12878_test"
fallback_url="https://f5c.bioinf.science/f5c_na12878_test_fallback";;
e) testdir=test/rna
bamfile=${testdir}/reads.sorted.bam
ref=${testdir}/gencode.v35.transcripts.fa
reads=${testdir}/reads.fastq
testset_url="https://f5c.page.link/f5c_rna_test"
fallback_url="https://f5c.page.link/f5c_rna_test_fallback";;
testset_url="https://f5c.bioinf.science/f5c_rna_test";;
f) testdir=test/hg2_lsk114_reads_1000
reads=${testdir}/PGXX22394_reads_1000_6.4.2_sup.fastq
slow5=${testdir}/PGXX22394_reads_1000.blow5
ref=test/chr22_meth_example/humangenome.fa
bamfile=${testdir}/PGXX22394_reads_1000_6.4.2_sup.bam
testset_url="https://f5c.page.link/hg2_lsk114_reads_1000";;
testset_url="https://f5c.bioinf.science/hg2_lsk114_reads_1000";;
z) testdir=test/uhr_rna004_1k
reads=${testdir}/PNXRXX240011_reads_1k.fastq
slow5=${testdir}/PNXRXX240011_reads_1k.blow5
ref=${testdir}/gencode.v40.transcripts.fa
bamfile=${testdir}/PNXRXX240011_reads_1k.bam
testset_url="https://f5c.bioinf.science/uhr_rna004_1k";;
K) batchsize="$OPTARG";;
B) max_bases="$OPTARG";;
d) download_test_set "https://f5c.page.link/f5c_na12878_test" "https://f5c.page.link/f5c_na12878_test_fallback"
d) download_test_set "https://f5c.bioinf.science/f5c_na12878_test" "https://f5c.bioinf.science/f5c_na12878_test_fallback"
exit 0;;
h) help_msg
exit 0;;
?) printf "Usage: %s [-c] [-b bam file] [-g reference genome] [-r fastq/fasta read] args" "$0"
?) printf "Usage: %s [-c/-e/-f/-z] [-b bam file] [-g reference genome] [-r fastq/fasta read] args" "$0"
exit 2;;
esac
done
Expand All @@ -206,7 +212,7 @@ cmd="${exepath} eventalign -b ${bamfile} -g ${ref} -r ${reads} -t ${threads} -K
if [ $testdir = test/rna ]; then
${exepath} index -d ${testdir}/fast5_files ${reads}
cmd="${cmd}"" --rna"
elif [ $testdir = test/hg2_lsk114_reads_1000 ]; then
elif [ $testdir = test/hg2_lsk114_reads_1000 ] || [ $testdir = test/uhr_rna004_1k ] ; then
${exepath} index -t12 --slow5 ${slow5} ${reads}
cmd="${cmd}"" --slow5 ${slow5}"
fi
Expand All @@ -216,7 +222,7 @@ if [ -z "$mode" ]; then
if [ $testdir = test/chr22_meth_example ]; then
${exepath} index -t12 --iop 12 -d ${testdir}/fast5_files/ ${reads}
${cmd} > /dev/null
elif [ $testdir = test/hg2_lsk114_reads_1000 ]; then
elif [ $testdir = test/hg2_lsk114_reads_1000 ] || [ $testdir = test/uhr_rna004_1k ] ; then
${exepath} index -t12 --slow5 ${slow5} ${reads}
${cmd} > ${testdir}/result.txt
else
Expand Down
15 changes: 13 additions & 2 deletions test/test_eventalign_pafsam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ execute_test() {
}

testdir=test/hg2_lsk114_reads_1000
download_test_set "https://f5c.page.link/hg2_lsk114_reads_1000"
download_test_set "https://f5c.bioinf.science/hg2_lsk114_reads_1000"

./f5c eventalign -b ${testdir}/PGXX22394_reads_1000_6.4.2_sup.bam \
-r ${testdir}/PGXX22394_reads_1000_6.4.2_sup.fastq -g test/chr22_meth_example/humangenome.fa \
Expand All @@ -63,7 +63,7 @@ execute_test ${testdir}/result.txt ${testdir}/eventalign.sam 50


testdir=test/rna
download_test_set "https://f5c.page.link/f5c_rna_test"
download_test_set "https://f5c.bioinf.science/f5c_rna_test"

./f5c eventalign -b ${testdir}/reads.sorted.bam -g ${testdir}/gencode.v35.transcripts.fa -r ${testdir}//reads.fastq \
--slow5 ${testdir}/reads.blow5 --rna -c > ${testdir}/result.txt || die "eventalign failed"
Expand All @@ -72,3 +72,14 @@ execute_test ${testdir}/result.txt ${testdir}/eventalign.paf 50
./f5c eventalign -b ${testdir}/reads.sorted.bam -g ${testdir}/gencode.v35.transcripts.fa -r ${testdir}//reads.fastq \
--slow5 ${testdir}/reads.blow5 --rna -a > ${testdir}/result.txt || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.sam 5

testdir=test/uhr_rna004_1k
download_test_set "https://f5c.bioinf.science/uhr_rna004_reads_1k"

./f5c eventalign -b ${testdir}/PNXRXX240011_reads_1k.bam -g ${testdir}/gencode.v40.transcripts.fa -r ${testdir}/PNXRXX240011_reads_1k.fastq \
--slow5 ${testdir}/PNXRXX240011_reads_1k.blow5 --rna -c > ${testdir}/result.txt || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.paf 50

./f5c eventalign -b ${testdir}/PNXRXX240011_reads_1k.bam -g ${testdir}/gencode.v40.transcripts.fa -r ${testdir}/PNXRXX240011_reads_1k.fastq \
--slow5 ${testdir}/PNXRXX240011_reads_1k.blow5 --rna -a > ${testdir}/result.txt || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.sam 5
2 changes: 1 addition & 1 deletion test/test_eventalign_parameters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
download_ecoli_2kb_region_big_testresults() {
mkdir -p test
tar_path=test/data.tgz
wget -O $tar_path "https://f5c.page.link/f5c_ecoli_2kb_region_big_testresults" || rm -rf $tar_path ${testdir}_big_testresults
wget -O $tar_path "https://f5c.bioinf.science/f5c_ecoli_2kb_region_big_testresults" || rm -rf $tar_path ${testdir}_big_testresults
echo "Extracting. Please wait."
tar -xf $tar_path -C test || rm -rf $tar_path ${testdir}_big_testresults
rm -f $tar_path
Expand Down
15 changes: 15 additions & 0 deletions test/test_extensive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ test_suit1 () {
echo "resquiggle"
test/test_rsq.sh -f 2> r10_hg2_resquiggle.log || die "failed"


echo "************************Doing RNA004 UHR tests*****************************"
echo "event alignment"
test/test_eventalign.sh -z 2> rna004_uhr_eventalign.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle"
test/test_rsq.sh -z 2> rna004_uhr_resquiggle.log || die "failed"

echo "************************Doing eventalign paf tests*****************************"
test/test_eventalign_pafsam.sh 2> eventalign_paf.log || die "failed"
echo ""
Expand Down Expand Up @@ -217,6 +225,13 @@ test_suit1_cuda () {
echo "resquiggle"
test/test_rsq.sh -f 2> r10_hg2_resquiggle_cuda.log || die "failed"

echo "************************Doing RNA004 UHR tests*****************************"
echo "event alignment"
test/test_eventalign.sh -z 2> rna004_uhr_eventalign_cuda.log || echo "failure ignored for now until smaller diffs are accounted"
echo "____________________________________________________________________"
echo "resquiggle"
test/test_rsq.sh -z 2> rna004_uhr_resquiggle_cuda.log || die "failed"

echo "************************Doing eventalign paf tests*****************************"
test/test_eventalign_pafsam.sh 2> eventalign_paf_cuda.log || die "failed"
echo ""
Expand Down
6 changes: 3 additions & 3 deletions test/test_multifast5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
fi
# execution mode (valgrind/gdb/cpu/cuda/echo)
mode=
testset_url="https://f5c.page.link/f5c_ecoli_2kb_region_multifast5_test"
testset_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_multifast5_test"
fallback_url=""

# download test set given url
Expand Down Expand Up @@ -124,11 +124,11 @@ do
bamfile=${testdir}/reads.sorted.bam
ref=test/chr22_meth_example/humangenome.fa
reads=${testdir}/reads.fastq
testset_url="https://f5c.page.link/f5c_na12878_multifast5_test"
testset_url="https://f5c.bioinf.science/f5c_na12878_multifast5_test"
fallback_url="";;
K) batchsize="$OPTARG";;
B) max_bases="$OPTARG";;
d) download_test_set "https://f5c.page.link/f5c_na12878_multifast5_test" ""
d) download_test_set "https://f5c.bioinf.science/f5c_na12878_multifast5_test" ""
exit 0;;
h) help_msg
exit 0;;
Expand Down
26 changes: 16 additions & 10 deletions test/test_rsq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ else
fi
# execution mode (valgrind/gdb/cpu/cuda/echo)
mode=
testset_url="https://f5c.page.link/f5c_ecoli_2kb_region_test"
fallback_url="https://f5c.page.link/f5c_ecoli_2kb_region_test_fallback"
testset_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_test"
fallback_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_test_fallback"

# download test set given url
#
Expand Down Expand Up @@ -111,6 +111,8 @@ help_msg() {
echo
echo "-c Uses chr22_meth_example test set."
echo "-e Uses rna test set."
echo "-f Uses hg2 dna r10 test set."
echo "-z Uses uhr rna004 test set."
echo "-K [n] Same as f5c -K."
echo "-B [n] Same as f5c -B."
echo "-r [read file] Same as f5c -r."
Expand All @@ -120,32 +122,36 @@ help_msg() {
}

# parse options
while getopts b:g:r:t:K:B:cdhef opt
while getopts b:g:r:t:K:B:cdhefz opt
do
case $opt in
r) reads="$OPTARG";;
t) threads="$OPTARG";;
c) testdir=test/chr22_meth_example
reads=${testdir}/reads.fastq
slow5=${testdir}/reads.blow5
testset_url="https://f5c.page.link/f5c_na12878_test"
fallback_url="https://f5c.page.link/f5c_na12878_test_fallback";;
testset_url="https://f5c.bioinf.science/f5c_na12878_test"
fallback_url="https://f5c.bioinf.science/f5c_na12878_test_fallback";;
e) testdir=test/rna
reads=${testdir}/reads.fastq
slow5=${testdir}/reads.blow5
testset_url="https://f5c.page.link/f5c_rna_test"
fallback_url="https://f5c.page.link/f5c_rna_test_fallback";;
testset_url="https://f5c.bioinf.science/f5c_rna_test"
fallback_url="https://f5c.bioinf.science/f5c_rna_test_fallback";;
f) testdir=test/hg2_lsk114_reads_1000
reads=${testdir}/PGXX22394_reads_1000_6.4.2_sup.fastq
slow5=${testdir}/PGXX22394_reads_1000.blow5
testset_url="https://f5c.page.link/hg2_lsk114_reads_1000";;
testset_url="https://f5c.bioinf.science/hg2_lsk114_reads_1000";;
z) testdir=test/uhr_rna004_1k
reads=${testdir}/PNXRXX240011_reads_1k.fastq
slow5=${testdir}/PNXRXX240011_reads_1k.blow5
testset_url="https://f5c.bioinf.science/uhr_rna004_1k";;
K) batchsize="$OPTARG";;
B) max_bases="$OPTARG";;
d) download_test_set "https://f5c.page.link/f5c_na12878_test" "https://f5c.page.link/f5c_na12878_test_fallback"
d) download_test_set "https://f5c.bioinf.science/f5c_na12878_test" "https://f5c.bioinf.science/f5c_na12878_test_fallback"
exit 0;;
h) help_msg
exit 0;;
?) printf "Usage: %s [-c] [-b bam file] [-g reference genome] [-r fastq/fasta read] args" "$0"
?) printf "Usage: %s [-c/-e/-f/-z] [-b bam file] [-g reference genome] [-r fastq/fasta read] args" "$0"
exit 2;;
esac
done
Expand Down
10 changes: 5 additions & 5 deletions test/test_slow5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ else
fi
# execution mode (valgrind/gdb/cpu/cuda/echo)
mode=
testset_url="https://f5c.page.link/f5c_ecoli_2kb_region_test"
fallback_url="https://f5c.page.link/f5c_ecoli_2kb_region_test_fallback"
testset_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_test"
fallback_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_test_fallback"

# download test set given url
#
Expand Down Expand Up @@ -126,11 +126,11 @@ do
ref=${testdir}/humangenome.fa
reads=${testdir}/reads.fastq
slow5=${testdir}/reads.blow5
testset_url="https://f5c.page.link/f5c_na12878_test"
fallback_url="https://f5c.page.link/f5c_na12878_test_fallback";;
testset_url="https://f5c.bioinf.science/f5c_na12878_test"
fallback_url="https://f5c.bioinf.science/f5c_na12878_test_fallback";;
K) batchsize="$OPTARG";;
B) max_bases="$OPTARG";;
d) download_test_set "https://f5c.page.link/f5c_na12878_test" "https://f5c.page.link/f5c_na12878_test_fallback"
d) download_test_set "https://f5c.bioinf.science/f5c_na12878_test" "https://f5c.bioinf.science/f5c_na12878_test_fallback"
exit 0;;
h) help_msg
exit 0;;
Expand Down
6 changes: 3 additions & 3 deletions test/test_vbz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
fi
# execution mode (valgrind/gdb/cpu/cuda/echo)
mode=
testset_url="https://f5c.page.link/f5c_ecoli_2kb_region_vbz_test"
testset_url="https://f5c.bioinf.science/f5c_ecoli_2kb_region_vbz_test"
fallback_url=""

# download test set given url
Expand Down Expand Up @@ -126,11 +126,11 @@ do
bamfile=${testdir}/reads.sorted.bam
ref=test/chr22_meth_example/humangenome.fa
reads=${testdir}/reads.fastq
testset_url="https://f5c.page.link/f5c_na12878_vbz_test"
testset_url="https://f5c.bioinf.science/f5c_na12878_vbz_test"
fallback_url="";;
K) batchsize="$OPTARG";;
B) max_bases="$OPTARG";;
d) download_test_set "https://f5c.page.link/f5c_na12878_vbz_test" ""
d) download_test_set "https://f5c.bioinf.science/f5c_na12878_vbz_test" ""
exit 0;;
h) help_msg
exit 0;;
Expand Down

0 comments on commit 73df18a

Please sign in to comment.