| 1 |
APPGROUP = conversion |
| 2 |
CWD := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))) |
| 3 |
CONVERT2BED = $(CWD)/../../bin/convert2bed |
| 4 |
CONVERT2BEDBIN = convert2bed |
| 5 |
TMP := $(shell mktemp -d) |
| 6 |
DATA = $(CWD)/data |
| 7 |
SHELL := /bin/bash |
| 8 |
|
| 9 |
all: |
| 10 |
@echo "Testing binary group [$(APPGROUP)] and build type [$(BUILDTYPE)]" |
| 11 |
@$(MAKE) tests |
| 12 |
|
| 13 |
tests: wig2bed |
| 14 |
@echo "Removing [$(TMP)]" |
| 15 |
@rm -rf $(TMP) |
| 16 |
|
| 17 |
wig2bed: wig2bed_prep wig2bed_with_chr_prefix_no_header wig2bed_no_chr_prefix_no_header wig2bed_fixedStep_with_chr_prefix_no_header wig2bed_fixedStep_no_chr_prefix_no_header wig2bed_variableStep_with_chr_prefix_no_header wig2bed_variableStep_no_chr_prefix_no_header wig2bed_multipleTracks_with_chr_prefix_with_header wig2bed_multipleTracks_no_chr_prefix_with_header |
| 18 |
|
| 19 |
wig2bed_prep: |
| 20 |
@[ -f $(CONVERT2BED) ] || echo "Missing binary [$(CONVERT2BED)] for build type [$(BUILDTYPE)]" |
| 21 |
@echo "Writing to [$(TMP)]" |
| 22 |
$(CONVERT2BED) --input=wig --version |
| 23 |
|
| 24 |
wig2bed_with_chr_prefix_no_header: |
| 25 |
# Test 001 |
| 26 |
# convert2bed --input=wig < tests/conversion/data/001.wig2bed_with_chr_prefix_no_header.001.wig > tests/conversion/data/001.wig2bed_with_chr_prefix_no_header.001.expected |
| 27 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 001]" |
| 28 |
@$(CONVERT2BED) --input=wig < $(DATA)/001.wig2bed_with_chr_prefix_no_header.001.wig > $(TMP)/001.wig2bed_with_chr_prefix_no_header.001.observed |
| 29 |
@diff $(TMP)/001.wig2bed_with_chr_prefix_no_header.001.observed $(DATA)/001.wig2bed_with_chr_prefix_no_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 30 |
@printf " ...passed!\n" |
| 31 |
|
| 32 |
wig2bed_no_chr_prefix_no_header: |
| 33 |
# Test 002 |
| 34 |
# convert2bed --input=wig < tests/conversion/data/002.wig2bed_no_chr_prefix_no_header.001.wig > tests/conversion/data/002.wig2bed_no_chr_prefix_no_header.001.expected |
| 35 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 002]" |
| 36 |
@$(CONVERT2BED) --input=wig < $(DATA)/002.wig2bed_no_chr_prefix_no_header.001.wig > $(TMP)/002.wig2bed_no_chr_prefix_no_header.001.observed |
| 37 |
@diff $(TMP)/002.wig2bed_no_chr_prefix_no_header.001.observed $(DATA)/002.wig2bed_no_chr_prefix_no_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 38 |
@printf " ...passed!\n" |
| 39 |
|
| 40 |
wig2bed_fixedStep_with_chr_prefix_no_header: |
| 41 |
# Test 003 |
| 42 |
# convert2bed --input=wig < tests/conversion/data/003.wig2bed_fixedStep_with_chr_prefix_no_header.001.wig > tests/conversion/data/003.wig2bed_fixedStep_with_chr_prefix_no_header.001.expected |
| 43 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 003 - step = 100, span = 1 (default)]" |
| 44 |
@$(CONVERT2BED) --input=wig < $(DATA)/003.wig2bed_fixedStep_with_chr_prefix_no_header.001.wig > $(TMP)/003.wig2bed_fixedStep_with_chr_prefix_no_header.001.observed |
| 45 |
@diff $(TMP)/003.wig2bed_fixedStep_with_chr_prefix_no_header.001.observed $(DATA)/003.wig2bed_fixedStep_with_chr_prefix_no_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 46 |
@printf " ...passed!\n" |
| 47 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 003 - step = 100, span = 5 (custom)]" |
| 48 |
@$(CONVERT2BED) --input=wig < $(DATA)/003.wig2bed_fixedStep_with_chr_prefix_no_header.002.wig > $(TMP)/003.wig2bed_fixedStep_with_chr_prefix_no_header.002.observed |
| 49 |
@diff $(TMP)/003.wig2bed_fixedStep_with_chr_prefix_no_header.002.observed $(DATA)/003.wig2bed_fixedStep_with_chr_prefix_no_header.002.expected || (printf " ...failed!\n" && exit 1) |
| 50 |
@printf " ...passed!\n" |
| 51 |
|
| 52 |
wig2bed_fixedStep_no_chr_prefix_no_header: |
| 53 |
# Test 004 |
| 54 |
# convert2bed --input=wig < tests/conversion/data/004.wig2bed_fixedStep_no_chr_prefix_no_header.001.wig > tests/conversion/data/004.wig2bed_fixedStep_no_chr_prefix_no_header.001.expected |
| 55 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 004 - step = 100, span = 1 (default)]" |
| 56 |
@$(CONVERT2BED) --input=wig < $(DATA)/004.wig2bed_fixedStep_no_chr_prefix_no_header.001.wig > $(TMP)/004.wig2bed_fixedStep_no_chr_prefix_no_header.001.observed |
| 57 |
@diff $(TMP)/004.wig2bed_fixedStep_no_chr_prefix_no_header.001.observed $(DATA)/004.wig2bed_fixedStep_no_chr_prefix_no_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 58 |
@printf " ...passed!\n" |
| 59 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 004 - step = 100, span = 5 (custom)]" |
| 60 |
@$(CONVERT2BED) --input=wig < $(DATA)/004.wig2bed_fixedStep_no_chr_prefix_no_header.002.wig > $(TMP)/004.wig2bed_fixedStep_no_chr_prefix_no_header.002.observed |
| 61 |
@diff $(TMP)/004.wig2bed_fixedStep_no_chr_prefix_no_header.002.observed $(DATA)/004.wig2bed_fixedStep_no_chr_prefix_no_header.002.expected || (printf " ...failed!\n" && exit 1) |
| 62 |
@printf " ...passed!\n" |
| 63 |
|
| 64 |
wig2bed_variableStep_with_chr_prefix_no_header: |
| 65 |
# Test 005 |
| 66 |
# convert2bed --input=wig < tests/conversion/data/005.wig2bed_variableStep_with_chr_prefix_no_header.001.wig > tests/conversion/data/005.wig2bed_variableStep_with_chr_prefix_no_header.001.expected |
| 67 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 005 - variable step, span = 1 (default)]" |
| 68 |
@$(CONVERT2BED) --input=wig < $(DATA)/005.wig2bed_variableStep_with_chr_prefix_no_header.001.wig > $(TMP)/005.wig2bed_variableStep_with_chr_prefix_no_header.001.observed |
| 69 |
@diff $(TMP)/005.wig2bed_variableStep_with_chr_prefix_no_header.001.observed $(DATA)/005.wig2bed_variableStep_with_chr_prefix_no_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 70 |
@printf " ...passed!\n" |
| 71 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 005 - variable step, span = 5 (custom)]" |
| 72 |
@$(CONVERT2BED) --input=wig < $(DATA)/005.wig2bed_variableStep_with_chr_prefix_no_header.002.wig > $(TMP)/005.wig2bed_variableStep_with_chr_prefix_no_header.002.observed |
| 73 |
@diff $(TMP)/005.wig2bed_variableStep_with_chr_prefix_no_header.002.observed $(DATA)/005.wig2bed_variableStep_with_chr_prefix_no_header.002.expected || (printf " ...failed!\n" && exit 1) |
| 74 |
@printf " ...passed!\n" |
| 75 |
|
| 76 |
wig2bed_variableStep_no_chr_prefix_no_header: |
| 77 |
# Test 006 |
| 78 |
# convert2bed --input=wig < tests/conversion/data/006.wig2bed_variableStep_no_chr_prefix_no_header.001.wig > tests/conversion/data/006.wig2bed_variableStep_no_chr_prefix_no_header.001.expected |
| 79 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 006 - variable step, span = 1 (default)]" |
| 80 |
@$(CONVERT2BED) --input=wig < $(DATA)/006.wig2bed_variableStep_no_chr_prefix_no_header.001.wig > $(TMP)/006.wig2bed_variableStep_no_chr_prefix_no_header.001.observed |
| 81 |
@diff $(TMP)/006.wig2bed_variableStep_no_chr_prefix_no_header.001.observed $(DATA)/006.wig2bed_variableStep_no_chr_prefix_no_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 82 |
@printf " ...passed!\n" |
| 83 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 006 - variable step, span = 5 (custom)]" |
| 84 |
@$(CONVERT2BED) --input=wig < $(DATA)/006.wig2bed_variableStep_no_chr_prefix_no_header.002.wig > $(TMP)/006.wig2bed_variableStep_no_chr_prefix_no_header.002.observed |
| 85 |
@diff $(TMP)/006.wig2bed_variableStep_no_chr_prefix_no_header.002.observed $(DATA)/006.wig2bed_variableStep_no_chr_prefix_no_header.002.expected || (printf " ...failed!\n" && exit 1) |
| 86 |
@printf " ...passed!\n" |
| 87 |
|
| 88 |
wig2bed_multipleTracks_with_chr_prefix_with_header: |
| 89 |
# Test 007 |
| 90 |
# convert2bed --input=wig < tests/conversion/data/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.wig > tests/conversion/data/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.expected |
| 91 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 007 - multiple tracks]" |
| 92 |
@$(CONVERT2BED) --input=wig < $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.wig > $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.observed |
| 93 |
@diff $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.observed $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 94 |
@printf " ...passed!\n" |
| 95 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 007 - multiple tracks, with --multisplit <str> option]" |
| 96 |
@$(CONVERT2BED) --input=wig --multisplit foo < $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.wig > $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.002.observed |
| 97 |
@diff $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.002.observed $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.002.expected || (printf " ...failed!\n" && exit 1) |
| 98 |
@printf " ...passed!\n" |
| 99 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 007 - multiple tracks, preserve header]" |
| 100 |
@$(CONVERT2BED) --input=wig --keep-header < $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.wig > $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.003.observed |
| 101 |
@diff $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.003.observed $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.003.expected || (printf " ...failed!\n" && exit 1) |
| 102 |
@printf " ...passed!\n" |
| 103 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 007 - multiple tracks, with --multisplit <str> option, preserve header]" |
| 104 |
@$(CONVERT2BED) --input=wig --multisplit foo --keep-header < $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.001.wig > $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.004.observed |
| 105 |
@diff $(TMP)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.004.observed $(DATA)/007.wig2bed_multipleTracks_with_chr_prefix_with_header.004.expected || (printf " ...failed!\n" && exit 1) |
| 106 |
@printf " ...passed!\n" |
| 107 |
|
| 108 |
wig2bed_multipleTracks_no_chr_prefix_with_header: |
| 109 |
# Test 008 |
| 110 |
# convert2bed --input=wig < tests/conversion/data/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.wig > tests/conversion/data/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.expected |
| 111 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 008 - multiple tracks, no chr prefix]" |
| 112 |
@$(CONVERT2BED) --input=wig < $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.wig > $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.observed |
| 113 |
@diff $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.observed $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.expected || (printf " ...failed!\n" && exit 1) |
| 114 |
@printf " ...passed!\n" |
| 115 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 008 - multiple tracks, no chr prefix, with --multisplit <str> option]" |
| 116 |
@$(CONVERT2BED) --input=wig --multisplit foo < $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.wig > $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.002.observed |
| 117 |
@diff $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.002.observed $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.002.expected || (printf " ...failed!\n" && exit 1) |
| 118 |
@printf " ...passed!\n" |
| 119 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 008 - multiple tracks, no chr prefix, preserve header]" |
| 120 |
@$(CONVERT2BED) --input=wig --keep-header < $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.wig > $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.003.observed |
| 121 |
@diff $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.003.observed $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.003.expected || (printf " ...failed!\n" && exit 1) |
| 122 |
@printf " ...passed!\n" |
| 123 |
@printf "[$(APPGROUP)-$(CONVERT2BEDBIN)-$(BUILDTYPE) | $@ ] - [Test 008 - multiple tracks, no chr prefix, with --multisplit <str> option, preserve header]" |
| 124 |
@$(CONVERT2BED) --input=wig --multisplit foo --keep-header < $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.001.wig > $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.004.observed |
| 125 |
@diff $(TMP)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.004.observed $(DATA)/008.wig2bed_multipleTracks_no_chr_prefix_with_header.004.expected || (printf " ...failed!\n" && exit 1) |
| 126 |
@printf " ...passed!\n" |