4 # -----------------------------------------------------------------------------
5 # Author: James Bonfield.
7 # This cross validation script is designed to run the htslib test_view
8 # and cramtools.jar CRAM implementations to test compatibility between
11 # The test set may contain many dubious and ambiguous SAM cases, such as
12 # single base reads (is that quality "*" really meaning Q9 or no quality?).
13 # Some of these may fail one or the other implementations and be acceptable
14 # in the short-term, so to spot more important regressions we can tag
15 # specific cases as being known-pass or known-fail.
16 # -----------------------------------------------------------------------------
21 cramtools_jar
=$HOME/work
/cram
/cramtools
/cramtools-
$vers.jar
23 test_view
="./test_view -o VERSION=$vers"
25 cramtools
="/software/bin/java -Xmx4000m -jar $cramtools_jar"
26 cramtools
="/software/bin/java -Xmx4000m -jar $cramtools_jar"
41 run_out _tmp.cram
$test_view -C -t $1 $2
42 #run_out _tmp.cram $HOME/io_lib/trunk/build.seq3/progs/scramble -r $1 -O CRAM $2
45 crash
=`expr $crash + 1`
51 run_out _tmp.sam
$test_view -i REFERENCE
=$1 _tmp.cram
52 #run_out _tmp.sam $HOME/io_lib/trunk/build.seq3/progs/scramble -r $1 _tmp.cram
56 crash
=`expr $crash + 1`
62 run
$cramtools cram
-R $1 -I $2 -O _tmp.cram
-n -Q --capture-all-tags
65 crash
=`expr $crash + 1`
71 run
$cramtools bam
-R $1 -I _tmp.cram
-O _tmp.sam
75 crash
=`expr $crash + 1`
81 #run ./compare_sam.pl $i _tmp.sam -nomd -notemplate -unknownrg -Baux
82 run .
/compare_sam.pl
$i _tmp.sam
-nomd -Baux
85 fails
=`expr $fails + 1`
96 # Restrict to known workers from SAM->CRAM->CRAM in cramtools
97 #files="auxf#values.sam c1#bounds.sam c1#noseq.sam c1#pad1.sam c1#pad2.sam c1#pad3.sam c1#unknown.sam ce#1.sam ce#2.sam ce#5b.sam ce#large_seq.sam ce#tag_depadded.sam ce#tag_padded.sam ce#unmap.sam ce#unmap1.sam ce#unmap2.sam xx#large_aux.sam xx#large_aux2.sam xx#pair.sam xx#rg.sam xx#unsorted.sam"
101 r
=`echo $i | sed 's/#.*/.fa/'`
105 trials
=`expr $trials + 1`
106 sam_to_Ccram
$r $i && Ccram_to_sam
$r && compare_sam
$i _tmp.sam
109 trials
=`expr $trials + 1`
110 sam_to_Jcram
$r $i && Jcram_to_sam
$r && compare_sam
$i _tmp.sam
113 trials
=`expr $trials + 1`
114 sam_to_Ccram
$r $i && Jcram_to_sam
$r && compare_sam
$i _tmp.sam
117 trials
=`expr $trials + 1`
118 sam_to_Jcram
$r $i && Ccram_to_sam
$r && compare_sam
$i _tmp.sam
121 # Overcounts failures as an early fail can lead to 1 or 2 more fails.
124 echo No. tests
: $trials
125 echo No. diffs
: $fails
126 echo No. crash
: $crash