Skip to content

Commit

Permalink
move test scripts to test
Browse files Browse the repository at this point in the history
  • Loading branch information
hasindu2008 committed Jun 14, 2023
1 parent dd6ab33 commit 9c870b4
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,4 @@ test: $(BINARY)
./scripts/test.sh

test_eventalign: $(BINARY)
./scripts/test_eventalign.sh
./test/test_eventalign.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions scripts/test_eventalign.sh → test/test_eventalign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ execute_test() {
tail -n +2 ${testdir}/f5c_event_align.summary.txt | awk '{print $1"\t"$2"\t"$3"\tna\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12"\t"$13"\t"$14}' > ${testdir}/f5c.summary.txt
#this test still passes if f5c.summary.txt is empty, but will be caught when comparing full summaries
join ${testdir}/nanopolish.summary.txt ${testdir}/f5c.summary.txt > ${testdir}/joined_results.txt || echo "Join ran into an issue. Probably just a warning."
awk -f scripts/test_eventalign_summary.awk ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests "${file}"
awk -f test/test_eventalign_summary.awk ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests "${file}"

if [ $testdir = test/chr22_meth_example ]; then
echo "event by event test not implemented not yet implemented!"
Expand All @@ -115,7 +115,7 @@ execute_test() {
tail -n +2 ${testdir}/result.txt > ${testdir}/f5c.txt
#todo : this must be fixed for join with two columns ideally
paste ${testdir}/nanopolish.txt ${testdir}/f5c.txt > ${testdir}/joined_results.txt
awk -f scripts/test_eventalign.awk ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests2 "${file}"
awk -f test/test_eventalign.awk ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests2 "${file}"
fi


Expand All @@ -142,6 +142,7 @@ help_msg() {
echo
echo "-c Uses chr22_meth_example test set."
echo "-e Uses rna test set."
echo "-f Uses hg2 datase."
echo "-b [bam file] Same as f5c -b."
echo "-K [n] Same as f5c -K."
echo "-B [n] Same as f5c -B."
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ execute_test() {
tail -n +2 ${testdir}/eventalign.summary.exp | awk '{print $1"\t"$2"\t"$3"\tdna\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12"\t"$13}' > ${testdir}/nanopolish.summary.txt
tail -n +2 ${testdir}/f5c_event_align.summary.txt | awk '{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"$11"\t"$12"\t"$13"\t"$14}' > ${testdir}/f5c.summary.txt
join ${testdir}/nanopolish.summary.txt ${testdir}/f5c.summary.txt > ${testdir}/joined_results.txt || echo "Join ran into an issue. Probably just a warning."
awk -f scripts/test_eventalign_summary.awk ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests "${testdir}/joined_diff.txt"
awk -f test/test_eventalign_summary.awk ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests "${testdir}/joined_diff.txt"

echo "----------------comparing full results--------------"
tail -n +2 ${testdir}_big_testresults/$1 > ${testdir}/nanopolish.txt
tail -n +2 ${testdir}/result.txt > ${testdir}/f5c.txt
paste ${testdir}/nanopolish.txt ${testdir}/f5c.txt > ${testdir}/joined_results.txt
awk -f scripts/$2 ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests2 "${testdir}/joined_diff.txt" $3
awk -f test/$2 ${testdir}/joined_results.txt > ${testdir}/joined_diff.txt || handle_tests2 "${testdir}/joined_diff.txt" $3


}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
70 changes: 35 additions & 35 deletions scripts/test_extensive.sh → test/test_extensive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ test_suit1 () {
scripts/test.sh 2> ecoli_methcalling.log || die "failed"
echo "____________________________________________________________________"
echo "event alignment"
scripts/test_eventalign.sh 2> ecoli_eventalign.log || die "failed"
test/test_eventalign.sh 2> ecoli_eventalign.log || die "failed"
echo "____________________________________________________________________"
echo "methylation frequency"
scripts/test_methfreq.sh 2> ecoli_methfreq.log || die "failed"
test/test_methfreq.sh 2> ecoli_methfreq.log || die "failed"
echo "____________________________________________________________________"
echo "multi-fast5"
scripts/test_multifast5.sh 2> ecoli_multifast5.log || die "failed"
test/test_multifast5.sh 2> ecoli_multifast5.log || die "failed"
echo "____________________________________________________________________"
echo "index"
scripts/test_index.sh 2> ecoli_index.log || die "failed"
test/test_index.sh 2> ecoli_index.log || die "failed"
echo "____________________________________________________________________"
echo "valgrind methcall"
scripts/test.sh valgrind 2> valgrind_methcall.log || die "failed"
Expand All @@ -81,19 +81,19 @@ test_suit1 () {
scripts/test.sh custom --kmer-model test/r9-models/r9.4_450bps.nucleotide.6mer.template.model --meth-model test/r9-models/r9.4_450bps.cpg.6mer.template.model 2> custom_6mer_methcall.log || die "failed"
echo "____________________________________________________________________"
echo "slow5"
scripts/test_slow5.sh 2> ecoli_slow5.log || die "failed"
test/test_slow5.sh 2> ecoli_slow5.log || die "failed"
echo "____________________________________________________________________"
echo "valgrind slow5"
scripts/test_slow5.sh valgrind 2> valgrind_slow5.log || die "failed"
test/test_slow5.sh valgrind 2> valgrind_slow5.log || die "failed"
echo "____________________________________________________________________"
echo "vbz"
scripts/test_vbz.sh 2> ecoli_vbz.log || die "failed"
test/test_vbz.sh 2> ecoli_vbz.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh 2> ecoli_resquiggle.log || die "failed"
test/test_rsq.sh 2> ecoli_resquiggle.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle valgrind"
scripts/test_rsq.sh valgrind 2> ecoli_resquiggle_valgrind.log || die "failed"
test/test_rsq.sh valgrind 2> ecoli_resquiggle_valgrind.log || die "failed"
echo "____________________________________________________________________"

echo ""
Expand All @@ -105,41 +105,41 @@ test_suit1 () {
scripts/test.sh -c 2> na12878_methcalling.log || die "failed"
echo "____________________________________________________________________"
echo "event alignment"
scripts/test_eventalign.sh -c 2> na12878_eventalign.log || die "failed"
test/test_eventalign.sh -c 2> na12878_eventalign.log || die "failed"
echo "____________________________________________________________________"
echo "methylation frequency"
scripts/test_methfreq.sh -c 2> na12878_methfreq.log || die "failed"
test/test_methfreq.sh -c 2> na12878_methfreq.log || die "failed"
echo "____________________________________________________________________"
echo "multi-fast5"
scripts/test_multifast5.sh -c 2> na12878_multifast5.log || die "failed"
test/test_multifast5.sh -c 2> na12878_multifast5.log || die "failed"
echo "____________________________________________________________________"
echo "index"
scripts/test_index.sh -c 2> na12878_index.log || die "failed"
test/test_index.sh -c 2> na12878_index.log || die "failed"
echo ""
echo "____________________________________________________________________"
echo "slow5"
scripts/test_slow5.sh -c 2> na12878_slow5.log || die "failed"
test/test_slow5.sh -c 2> na12878_slow5.log || die "failed"

echo "************************Doing RNA tests*****************************"
echo "event alignment"
scripts/test_eventalign.sh -e 2> rna_eventalign.log || die "failed"
test/test_eventalign.sh -e 2> rna_eventalign.log || die "failed"
echo "____________________________________________________________________"
echo "valgrind eventalign"
scripts/test_eventalign.sh -e valgrind 2> valgrind_rna_eventalign.log || die "failed"
test/test_eventalign.sh -e valgrind 2> valgrind_rna_eventalign.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh -e 2> rna_resquiggle.log || die "failed"
test/test_rsq.sh -e 2> rna_resquiggle.log || die "failed"


echo "************************Doing R10 HG2 tests*****************************"
echo "Methylation calling"
scripts/test.sh -f 2> r10_hg2_methcalling.log || die "failed"
echo "____________________________________________________________________"
echo "event alignment"
scripts/test_eventalign.sh -f 2> r10_hg2_eventalign.log || die "failed"
test/test_eventalign.sh -f 2> r10_hg2_eventalign.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh -f 2> r10_hg2_resquiggle.log || die "failed"
test/test_rsq.sh -f 2> r10_hg2_resquiggle.log || die "failed"

echo ""
echo "*********************************************************************"
Expand All @@ -156,19 +156,19 @@ test_suit1_cuda () {
scripts/test.sh 2> ecoli_methcalling_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "event alignment"
scripts/test_eventalign.sh 2> ecoli_eventalign_cuda.log || die "failed"
test/test_eventalign.sh 2> ecoli_eventalign_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "methylation frequency"
scripts/test_methfreq.sh 2> ecoli_methfreq_cuda.log || die "failed"
test/test_methfreq.sh 2> ecoli_methfreq_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "multi-fast5"
scripts/test_multifast5.sh 2> ecoli_multifast5_cuda.log || die "failed"
test/test_multifast5.sh 2> ecoli_multifast5_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "slow5"
scripts/test_slow5.sh 2> ecoli_slow5_cuda.log || die "failed"
test/test_slow5.sh 2> ecoli_slow5_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh 2> ecoli_resquiggle_cuda.log || die "failed"
test/test_rsq.sh 2> ecoli_resquiggle_cuda.log || die "failed"
echo "____________________________________________________________________"

echo ""
Expand All @@ -180,38 +180,38 @@ test_suit1_cuda () {
scripts/test.sh -c 2> na12878_methcalling_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "event alignment"
scripts/test_eventalign.sh -c 2> na12878_eventalign_cuda.log || die "failed"
test/test_eventalign.sh -c 2> na12878_eventalign_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "methylation frequency"
scripts/test_methfreq.sh -c 2> na12878_methfreq_cuda.log || die "failed"
test/test_methfreq.sh -c 2> na12878_methfreq_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "multi-fast5"
scripts/test_multifast5.sh -c 2> na12878_multifast5_cuda.log || die "failed"
test/test_multifast5.sh -c 2> na12878_multifast5_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "slow5"
scripts/test_slow5.sh -c 2> na12878_slow5_cuda.log || die "failed"
test/test_slow5.sh -c 2> na12878_slow5_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh -c 2> na12878_resquiggle_cuda.log || die "failed"
test/test_rsq.sh -c 2> na12878_resquiggle_cuda.log || die "failed"


echo "************************Doing RNA tests*****************************"
echo "event alignment"
scripts/test_eventalign.sh -e 2> rna_eventalign_cuda.log || echo "failure ignored until paste is implemented with join in full event align output"
test/test_eventalign.sh -e 2> rna_eventalign_cuda.log || echo "failure ignored until paste is implemented with join in full event align output"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh -e 2> rna_resquiggle_cuda.log || die "failed"
test/test_rsq.sh -e 2> rna_resquiggle_cuda.log || die "failed"


echo "************************Doing R10 HG2 tests*****************************"
echo "Methylation calling"
scripts/test.sh -f 2> r10_hg2_methcalling_cuda.log || die "failed"
echo "____________________________________________________________________"
echo "event alignment"
scripts/test_eventalign.sh -f 2> r10_hg2_eventalign_cuda.log || echo "failure ignored for now until smaller diffs are accounted"
test/test_eventalign.sh -f 2> r10_hg2_eventalign_cuda.log || echo "failure ignored for now until smaller diffs are accounted"
echo "____________________________________________________________________"
echo "resquiggle"
scripts/test_rsq.sh -f 2> r10_hg2_resquiggle.log || die "failed"
test/test_rsq.sh -f 2> r10_hg2_resquiggle.log || die "failed"

echo ""
echo "*********************************************************************"
Expand Down Expand Up @@ -303,12 +303,12 @@ test_suit_eventalign_extra () {
echo "************************event align extra tests**********************"

echo "Event align parameter tests"
scripts/test_eventalign_parameters.sh 2> event_align_parameters.txt || die "failed"
test/test_eventalign_parameters.sh 2> event_align_parameters.txt || die "failed"
echo ""
echo "____________________________________________________________________"

echo "valgrind test"
scripts/test_eventalign.sh valgrind 2> valgrind_event_align.txt || die "failed"
test/test_eventalign.sh valgrind 2> valgrind_event_align.txt || die "failed"
echo ""
echo "____________________________________________________________________"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9c870b4

Please sign in to comment.