| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
bin_dir="/usr/local/bin" |
| 4 |
psl2bed_bin="${bin_dir}/psl2bed" |
| 5 |
psl2starch_bin="${bin_dir}/psl2starch" |
| 6 |
|
| 7 |
echo "[psl2bed] testing headered output..." |
| 8 |
sample_psl_fn="sample.headered.psl" |
| 9 |
expected_sorted_bed_fn="sample.expected.headered.bed" |
| 10 |
observed_sorted_bed_fn="$(mktemp /tmp/XXXXXX)" |
| 11 |
${psl2bed_bin} < ${sample_psl_fn} > ${observed_sorted_bed_fn} 2> /dev/null |
| 12 |
diff -q ${expected_sorted_bed_fn} ${observed_sorted_bed_fn} |
| 13 |
rm -f ${observed_sorted_bed_fn} |
| 14 |
|
| 15 |
echo "[psl2bed] testing headerless output..." |
| 16 |
sample_psl_fn="sample.headerless.psl" |
| 17 |
expected_sorted_bed_fn="sample.expected.headerless.bed" |
| 18 |
observed_sorted_bed_fn="$(mktemp /tmp/XXXXXX)" |
| 19 |
${psl2bed_bin} < ${sample_psl_fn} > ${observed_sorted_bed_fn} 2> /dev/null |
| 20 |
diff -q ${expected_sorted_bed_fn} ${observed_sorted_bed_fn} |
| 21 |
rm -f ${observed_sorted_bed_fn} |
| 22 |
|
| 23 |
echo "[psl2bed] testing headerless split output..." |
| 24 |
sample_psl_fn="sample.headerless.psl" |
| 25 |
expected_sorted_bed_fn="sample.expected.headerless.split.bed" |
| 26 |
observed_sorted_bed_fn="$(mktemp /tmp/XXXXXX)" |
| 27 |
${psl2bed_bin} --split < ${sample_psl_fn} > ${observed_sorted_bed_fn} 2> /dev/null |
| 28 |
diff -q ${expected_sorted_bed_fn} ${observed_sorted_bed_fn} |
| 29 |
rm -f ${observed_sorted_bed_fn} |
| 30 |
|
| 31 |
echo "[psl2bed] testing headered starch (bzip2) output..." |
| 32 |
sample_psl_fn="sample.headered.psl" |
| 33 |
expected_starch_fn="sample.expected.headered.starch" |
| 34 |
observed_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 35 |
${psl2starch_bin} < ${sample_psl_fn} > ${observed_starch_fn} 2> /dev/null |
| 36 |
diff -q <(unstarch ${expected_starch_fn}) <(unstarch ${observed_starch_fn}) |
| 37 |
rm -f ${observed_starch_fn} |
| 38 |
|
| 39 |
echo "[psl2bed] testing headered starch (gzip) output..." |
| 40 |
sample_psl_fn="sample.headered.psl" |
| 41 |
expected_starch_fn="sample.expected.headered.gzip.starch" |
| 42 |
observed_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 43 |
${psl2starch_bin} --starch-gzip < ${sample_psl_fn} > ${observed_starch_fn} 2> /dev/null |
| 44 |
diff -q <(unstarch ${expected_starch_fn}) <(unstarch ${observed_starch_fn}) |
| 45 |
rm -f ${observed_starch_fn} |
| 46 |
|
| 47 |
echo "[psl2bed] testing headerless starch (bzip2) output..." |
| 48 |
sample_psl_fn="sample.headerless.psl" |
| 49 |
expected_starch_fn="sample.expected.headerless.starch" |
| 50 |
observed_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 51 |
${psl2starch_bin} < ${sample_psl_fn} > ${observed_starch_fn} 2> /dev/null |
| 52 |
diff -q <(unstarch ${expected_starch_fn}) <(unstarch ${observed_starch_fn}) |
| 53 |
rm -f ${observed_starch_fn} |
| 54 |
|
| 55 |
echo "[psl2bed] testing headerless split starch (bzip2) output..." |
| 56 |
sample_psl_fn="sample.headerless.psl" |
| 57 |
expected_starch_fn="sample.expected.headerless.split.starch" |
| 58 |
observed_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 59 |
${psl2starch_bin} --split < ${sample_psl_fn} > ${observed_starch_fn} 2> /dev/null |
| 60 |
diff -q <(unstarch ${expected_starch_fn}) <(unstarch ${observed_starch_fn}) |
| 61 |
rm -f ${observed_starch_fn} |
| 62 |
|
| 63 |
echo "[psl2bed] testing headerless starch (gzip) output..." |
| 64 |
sample_psl_fn="sample.headerless.psl" |
| 65 |
expected_starch_fn="sample.expected.headerless.gzip.starch" |
| 66 |
observed_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 67 |
${psl2starch_bin} --starch-gzip < ${sample_psl_fn} > ${observed_starch_fn} 2> /dev/null |
| 68 |
diff -q <(unstarch ${expected_starch_fn}) <(unstarch ${observed_starch_fn}) |
| 69 |
rm -f ${observed_starch_fn} |
| 70 |
|
| 71 |
echo "[psl2bed] testing headerless split starch (gzip) output..." |
| 72 |
sample_psl_fn="sample.headerless.psl" |
| 73 |
expected_starch_fn="sample.expected.headerless.split.gzip.starch" |
| 74 |
observed_starch_fn="$(mktemp /tmp/XXXXXX)" |
| 75 |
${psl2starch_bin} --starch-gzip --split < ${sample_psl_fn} > ${observed_starch_fn} 2> /dev/null |
| 76 |
diff -q <(unstarch ${expected_starch_fn}) <(unstarch ${observed_starch_fn}) |
| 77 |
rm -f ${observed_starch_fn} |
| 78 |
|
| 79 |
echo "[psl2bed] tests complete!" |