| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
bin_dir="/usr/local/bin" |
| 4 |
vcf2bed_bin="${bin_dir}/vcf2bed" |
| 5 |
vcf2starch_bin="${bin_dir}/vcf2starch" |
| 6 |
|
| 7 |
echo "[vcf2bed] testing sorted and split output..." |
| 8 |
sample_split_vcf_fn="sample.vcf" |
| 9 |
expected_split_sorted_bed_fn="sample.expected.split.bed" |
| 10 |
observed_split_sorted_bed_fn="$(mktemp /tmp/XXXXXX)" |
| 11 |
${vcf2bed_bin} < ${sample_split_vcf_fn} > ${observed_split_sorted_bed_fn} 2> /dev/null |
| 12 |
diff -q ${expected_split_sorted_bed_fn} ${observed_split_sorted_bed_fn} |
| 13 |
rm -f ${observed_split_sorted_bed_fn} |
| 14 |
|
| 15 |
echo "[vcf2bed] testing sorted and no-split output..." |
| 16 |
sample_nosplit_vcf_fn="sample.vcf" |
| 17 |
expected_nosplit_sorted_bed_fn="sample.expected.nosplit.bed" |
| 18 |
observed_nosplit_sorted_bed_fn="$(mktemp /tmp/XXXXXX)" |
| 19 |
${vcf2bed_bin} --do-not-split < ${sample_nosplit_vcf_fn} > ${observed_nosplit_sorted_bed_fn} 2> /dev/null |
| 20 |
diff -q ${expected_nosplit_sorted_bed_fn} ${observed_nosplit_sorted_bed_fn} |
| 21 |
rm -f ${observed_nosplit_sorted_bed_fn} |
| 22 |
|
| 23 |
echo "[vcf2bed] testing starch split (bzip2) output..." |
| 24 |
sample_vcf_fn="sample.vcf" |
| 25 |
expected_split_starch_fn="sample.expected.split.bzip2.starch" |
| 26 |
observed_split_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 27 |
${vcf2starch_bin} < ${sample_vcf_fn} > ${observed_split_starch_fn} 2> /dev/null |
| 28 |
diff -q <(unstarch ${expected_split_starch_fn}) <(unstarch ${observed_split_starch_fn}) |
| 29 |
rm -f ${observed_split_starch_fn} |
| 30 |
|
| 31 |
echo "[vcf2bed] testing starch (gzip) output..." |
| 32 |
sample_vcf_fn="sample.vcf" |
| 33 |
expected_split_starch_fn="sample.expected.split.gzip.starch" |
| 34 |
observed_split_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 35 |
${vcf2starch_bin} --starch-gzip < ${sample_vcf_fn} > ${observed_split_starch_fn} 2> /dev/null |
| 36 |
diff -q <(unstarch ${expected_split_starch_fn}) <(unstarch ${observed_split_starch_fn}) |
| 37 |
rm -f ${observed_split_starch_fn} |
| 38 |
|
| 39 |
echo "[vcf2bed] testing starch no-split (bzip2) output..." |
| 40 |
sample_vcf_fn="sample.vcf" |
| 41 |
expected_split_starch_fn="sample.expected.nosplit.bzip2.starch" |
| 42 |
observed_split_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 43 |
${vcf2starch_bin} --do-not-split < ${sample_vcf_fn} > ${observed_split_starch_fn} 2> /dev/null |
| 44 |
diff -q <(unstarch ${expected_split_starch_fn}) <(unstarch ${observed_split_starch_fn}) |
| 45 |
rm -f ${observed_split_starch_fn} |
| 46 |
|
| 47 |
echo "[vcf2bed] testing starch (gzip) output..." |
| 48 |
sample_vcf_fn="sample.vcf" |
| 49 |
expected_split_starch_fn="sample.expected.nosplit.gzip.starch" |
| 50 |
observed_split_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 51 |
${vcf2starch_bin} --do-not-split --starch-gzip < ${sample_vcf_fn} > ${observed_split_starch_fn} 2> /dev/null |
| 52 |
diff -q <(unstarch ${expected_split_starch_fn}) <(unstarch ${observed_split_starch_fn}) |
| 53 |
rm -f ${observed_split_starch_fn} |
| 54 |
|
| 55 |
echo "[vcf2bed] tests complete!" |