IntegrationTest/DIDA/compare-fastx
raw| 1 | #!/bin/bash |
| 2 | set -eu -o pipefail |
| 3 | |
| 4 | if [ $# -ne 2 ]; then |
| 5 | echo "Usage: $(basename $0) <file1> <file2>" >&2 |
| 6 | echo "Compare FASTX files without regard for sequence orientation." >&2 |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | function canonical_seqs { |
| 11 | bioawk -c fastx '{print $seq; print revcomp($seq)}' "$@" | sort |
| 12 | } |
| 13 | |
| 14 | diff <(canonical_seqs $1) <(canonical_seqs $2) |