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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
|
# Create the file of file:
ls humch1_00* > fof.txt
#####################
# Default option run:
#####################
run_discoSnp++.sh -r fof.txt -T -P 1
if [ $? -ne 0 ] ; then
echo "*** Default option FAILURE:"
echo "*** discoSnp failure"
exit 1
fi
# Test the .fa
# The sequence ids and orders are not conserved due to parallelisation. This explains why we separate sequences from headers and why we remove ids
grep -v ">" ref_discoRes_k_31_c_3_D_100_P_1_b_0_coherent.fa | sort > ref
grep -v ">" discoRes_k_31_c_3_D_100_P_1_b_0_coherent.fa | sort > created
diff ref created
if [ $? -ne 0 ] ; then
echo "*** Default option FAILURE:"
echo "*** Test: FAILURE on diff sequences of .fa"
exit 1
fi
grep ">" ref_discoRes_k_31_c_3_D_100_P_1_b_0_coherent.fa |cut -d "|" -f 2- | sort > ref
grep ">" discoRes_k_31_c_3_D_100_P_1_b_0_coherent.fa |cut -d "|" -f 2- | sort > created
diff ref created
if [ $? -ne 0 ] ; then
echo "*** Default option FAILURE:"
echo "*** Test: FAILURE on diff headers of .fa"
exit 1
fi
# Test the .vcf headers
grep "^#" ref_discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | grep -v filedate > ref
grep "^#" discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | grep -v filedate > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** Default option FAILURE:"
echo "*** Test: FAILURE on diff headers of .vcf"
exit 1
fi
# Test the .vcf content
awk '!/#/' ref_discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | cut -f 2,4- | sort > ref
awk '!/#/' discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | cut -f 2,4- | sort > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** Default option FAILURE:"
echo "*** Test: FAILURE on diff content of .vcf"
exit 1
fi
######################################################
# With reference run (using previously created graph):
######################################################
../../run_discoSnp++.sh -r fof.txt -T -G humch1_first_5M.fasta -g discoRes_k_31_c_3.h5 -P 1
if [ $? -ne 0 ] ; then
echo "*** With mapping on ref FAILURE:"
echo "*** discoSnp failure"
exit 1
fi
# Test the .vcf headers
grep "^#" ref_with_mapping_discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | grep -v filedate > ref
grep "^#" discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | grep -v filedate > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff headers of .vcf"
exit 1
fi
# Test the .vcf content
awk '!/#/' ref_with_mapping_discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | cut -f 2,4- | grep -v "MULTIPLE" |sort > ref # MULTIPLE are not deterministics
awk '!/#/' discoRes_k_31_c_3_D_100_P_1_b_0_coherent.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff content of .vcf"
exit 1
fi
# Test the for IGV .vcf headers
grep "^#" ref_with_mapping_discoRes_k_31_c_3_D_100_P_1_b_0_coherent_for_IGV.vcf | grep -v filedate > ref
grep "^#" discoRes_k_31_c_3_D_100_P_1_b_0_coherent_for_IGV.vcf | grep -v filedate > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff headers of for IGV .vcf"
exit 1
fi
# Test the for IGV .vcf content
awk '!/#/' ref_with_mapping_discoRes_k_31_c_3_D_100_P_1_b_0_coherent_for_IGV.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > ref
awk '!/#/' discoRes_k_31_c_3_D_100_P_1_b_0_coherent_for_IGV.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff content of for IGV .vcf"
exit 1
fi
#####################
# CLOSE SNPS option run:
#####################
../../run_discoSnp++.sh -r fof.txt -T -P 10
if [ $? -ne 0 ] ; then
echo "*** With close SNPS FAILURE:"
echo "*** discoSnp failure"
exit 1
fi
# Test the .fa
# The sequence ids and orders are not conserved due to parallelisation. This explains why we separate sequences from headers and why we remove ids
grep -v ">" ref_discoRes_k_31_c_3_D_100_P_10_b_0_coherent.fa | sort > ref
grep -v ">" discoRes_k_31_c_3_D_100_P_10_b_0_coherent.fa | sort > created
diff ref created
if [ $? -ne 0 ] ; then
echo "*** With close SNPS FAILURE:"
echo "*** Test: FAILURE on diff sequences of .fa"
exit 1
fi
grep ">" ref_discoRes_k_31_c_3_D_100_P_10_b_0_coherent.fa |cut -d "|" -f 2- | sort > ref
grep ">" discoRes_k_31_c_3_D_100_P_10_b_0_coherent.fa |cut -d "|" -f 2- | sort > created
diff ref created
if [ $? -ne 0 ] ; then
echo "*** With close SNPS FAILURE:"
echo "*** Test: FAILURE on diff headers of .fa"
exit 1
fi
# Test the .vcf headers
grep "^#" ref_discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | grep -v filedate > ref
grep "^#" discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | grep -v filedate > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With close SNPS FAILURE:"
echo "*** Test: FAILURE on diff headers of .vcf"
exit 1
fi
# Test the .vcf content
awk '!/#/' ref_discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | cut -f 2,4- | sort > ref
awk '!/#/' discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | cut -f 2,4- | sort > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With close SNPS FAILURE:"
echo "*** Test: FAILURE on diff content of .vcf"
exit 1
fi
######################################################
# With reference run (using previously created graph):
######################################################
../../run_discoSnp++.sh -r fof.txt -T -G humch1_first_5M.fasta -g discoRes_k_31_c_3.h5 -P 10
if [ $? -ne 0 ] ; then
echo "*** With close SNPS and mapping on ref FAILURE:"
echo "*** discoSnp failure"
exit 1
fi
# Test the .vcf headers
grep "^#" ref_with_mapping_discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | grep -v filedate > ref
grep "^#" discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | grep -v filedate > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With close SNPS and mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff headers of .vcf"
exit 1
fi
# Test the .vcf content
awk '!/#/' ref_with_mapping_discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > ref
awk '!/#/' discoRes_k_31_c_3_D_100_P_10_b_0_coherent.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With close SNPS and mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff content of .vcf"
exit 1
fi
# Test the for IGV .vcf headers
grep "^#" ref_with_mapping_discoRes_k_31_c_3_D_100_P_10_b_0_coherent_for_IGV.vcf | grep -v filedate > ref
grep "^#" discoRes_k_31_c_3_D_100_P_10_b_0_coherent_for_IGV.vcf | grep -v filedate > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With close SNPS and mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff headers of for IGV .vcf"
exit 1
fi
# Test the for IGV .vcf content
awk '!/#/' ref_with_mapping_discoRes_k_31_c_3_D_100_P_10_b_0_coherent_for_IGV.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > ref
awk '!/#/' discoRes_k_31_c_3_D_100_P_10_b_0_coherent_for_IGV.vcf | cut -f 2,4- | grep -v "MULTIPLE" | sort > created
diff created ref
if [ $? -ne 0 ] ; then
echo "*** With close SNPS and mapping on ref FAILURE:"
echo "*** Test: FAILURE on diff content of for IGV .vcf"
exit 1
fi
######################################################
# test the radseq option (-x) #
######################################################
# ../../run_discoSnpRad.sh -r fof_rad.txt -k 31 -b 2 -D 0 -P 4 -p radtest
#
# if [ $? -ne 0 ] ; then
# echo "*** With truncated bubbles FAILURE:"
# echo "*** discoSnp failure"
# exit 1
# fi
#
# # Test the .fa
# # The sequence ids and orders are not conserved due to parallelisation. This explains why we separate sequences from headers and why we remove ids
# grep -v ">" rad_option_test/radref_k_31_c_3_D_0_P_4_b_2_coherent.fa | sort -n > radref
# grep -v ">" radtest_k_31_c_3_D_0_P_4_b_2_coherent.fa | sort -n > radtest
# diff radref radtest
# if [ $? -ne 0 ] ; then
# echo "*** With truncated bubbles FAILURE:"
# echo "*** Test: FAILURE on diff sequences of .fa"
# exit 1
# fi
#
# grep ">" rad_option_test/radref_k_31_c_3_D_0_P_4_b_2_coherent.fa |cut -d "|" -f 2- | sort -n > radref
# grep ">" radtest_k_31_c_3_D_0_P_4_b_2_coherent.fa |cut -d "|" -f 2- | sort -n > radtest
# diff radref radtest
# if [ $? -ne 0 ] ; then
# echo "*** With truncated bubbles FAILURE:"
# echo "*** Test: FAILURE on diff headers of .fa"
# exit 1
# fi
#
# rm radref radtest*
echo "****************************"
echo "***** ALL TESTS PASSED *****"
echo "****************************"
|