Skip to content

Commit

Permalink
fix workflow and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hasindu2008 committed Jun 14, 2023
1 parent 9c870b4 commit 7d4e2f0
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions test/test_eventalign_pafsam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,50 @@ download_test_set() {
rm -f $tar_path
}



handle_tests() {
numfailed=$(wc -l < ${testdir}/diff.txt)
numcases=$(wc -l < ${ORIG})
numres=$(wc -l < ${RES})
echo "$numfailed of $numcases test cases deviated."
missing=$(echo "$numcases-$numres" | bc)
echo "$missing entries in the truthset are missing in the testset"
failp=$(echo "$numfailed*100/$numcases" | bc)
[ "$failp" -gt ${THRESH} ] && die "${1}: Validation failed"
echo "Validation passed"
}

execute_test() {

ORIG=$2
RES=$1
THRESH=5
diff -y --suppress-common-lines ${ORIG} ${RES} > ${testdir}/diff.txt || handle_tests $testdir

}

testdir=test/hg2_lsk114_reads_1000
download_test_set "https://f5c.page.link/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 \
--slow5 ${testdir}/PGXX22394_reads_1000.blow5 -c > ${testdir}/result.txt || die "eventalign failed"
diff -q ${testdir}/result.txt ${testdir}/eventalign.paf || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.paf

./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 \
--slow5 ${testdir}/PGXX22394_reads_1000.blow5 -a > ${testdir}/result.txt || die "eventalign failed"
diff -q ${testdir}/result.txt ${testdir}/eventalign.sam || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.sam


testdir=test/rna
download_test_set "https://f5c.page.link/rna"
download_test_set "https://f5c.page.link/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"
diff -q ${testdir}/result.txt ${testdir}/eventalign.paf || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.paf

./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"
diff -q ${testdir}/result.txt ${testdir}/eventalign.sam || die "eventalign failed"
execute_test ${testdir}/result.txt ${testdir}/eventalign.sam

0 comments on commit 7d4e2f0

Please sign in to comment.