Skip to content

Commit

Permalink
Abstract ref_to_m5 from cram_io
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHickman committed Sep 11, 2017
1 parent 1cc6afd commit db1c511
Show file tree
Hide file tree
Showing 10 changed files with 679 additions and 327 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ lib*.so.*
/test/test-vcf-api
/test/test-vcf-sweep
/test/test-bcf-sr
/test/test-ref
/test/test_view
/test/thrash_threads[1-6]
/test/*.tmp
Expand Down
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ BUILT_TEST_PROGRAMS = \
test/hfile \
test/sam \
test/test_bgzf \
test/test-ref \
test/test-regidx \
test/test_view \
test/test-vcf-api \
Expand Down Expand Up @@ -154,6 +155,7 @@ LIBHTS_OBJS = \
multipart.o \
probaln.o \
realn.o \
ref.o \
regidx.o \
sam.o \
synced_bcf_reader.o \
Expand Down Expand Up @@ -326,13 +328,14 @@ plugin.o plugin.pico: plugin.c config.h $(hts_internal_h) $(htslib_kstring_h)
probaln.o probaln.pico: probaln.c config.h $(htslib_hts_h)
realn.o realn.pico: realn.c config.h $(htslib_hts_h) $(htslib_sam_h)
textutils.o textutils.pico: textutils.c config.h $(htslib_hfile_h) $(htslib_kstring_h) $(hts_internal_h)
ref.o ref.pico: ref.c config.h $(htslib_kstring_h) $(htslib_bgzf_h) $(cram_h) $(cram_io_h) $(cram_open_trace_file_h) $(htslib_hfile_h)

cram/cram_codecs.o cram/cram_codecs.pico: cram/cram_codecs.c config.h $(cram_h)
cram/cram_decode.o cram/cram_decode.pico: cram/cram_decode.c config.h $(cram_h) $(cram_os_h) $(htslib_hts_h)
cram/cram_encode.o cram/cram_encode.pico: cram/cram_encode.c config.h $(cram_h) $(cram_os_h) $(htslib_hts_h) $(htslib_hts_endian_h)
cram/cram_external.o cram/cram_external.pico: cram/cram_external.c config.h $(htslib_hfile_h) $(cram_h)
cram/cram_index.o cram/cram_index.pico: cram/cram_index.c config.h $(htslib_bgzf_h) $(htslib_hfile_h) $(hts_internal_h) $(cram_h) $(cram_os_h)
cram/cram_io.o cram/cram_io.pico: cram/cram_io.c config.h $(cram_h) $(cram_os_h) $(htslib_hts_h) $(cram_open_trace_file_h) cram/rANS_static.h $(htslib_hfile_h) $(htslib_bgzf_h) $(htslib_faidx_h) $(hts_internal_h)
cram/cram_io.o cram/cram_io.pico: cram/cram_io.c config.h $(cram_h) $(cram_os_h) $(htslib_hts_h) $(htslib_ref_h) $(cram_open_trace_file_h) cram/rANS_static.h $(htslib_hfile_h) $(htslib_bgzf_h) $(htslib_faidx_h) $(hts_internal_h)
cram/cram_samtools.o cram/cram_samtools.pico: cram/cram_samtools.c config.h $(cram_h) $(htslib_sam_h)
cram/cram_stats.o cram/cram_stats.pico: cram/cram_stats.c config.h $(cram_h) $(cram_os_h)
cram/files.o cram/files.pico: cram/files.c config.h $(cram_misc_h)
Expand Down Expand Up @@ -364,7 +367,7 @@ tabix.o: tabix.c config.h $(htslib_tbx_h) $(htslib_sam_h) $(htslib_vcf_h) $(htsl
#
# If using MSYS, avoid poor shell expansion via:
# MSYS2_ARG_CONV_EXCL="*" make check
check test: $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS)
check test: $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS) test_ebi_fetch
test/hts_endian
test/fieldarith test/fieldarith.sam
test/hfile
Expand All @@ -374,6 +377,18 @@ check test: $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS)
test/test-regidx
cd test && REF_PATH=: ./test.pl $${TEST_OPTS:-}

test_ebi_fetch:
export REF_CACHE=`mktemp -d` && \
test/test_view -t test/xx.fa -S -C test/xx#rg.sam > test/xx#rg.tmp.cram && \
test/test_view -D test/xx#rg.tmp.cram > /dev/null && \
test/test_view -D test/xx#rg.tmp.cram > /dev/null && \
rm -rf $$REF_CACHE
export REF_CACHE=`mktemp -d` && \
test/test-ref && \
test/test-ref && \
rm -rf $$REF_CACHE


test/hts_endian: test/hts_endian.o
$(CC) $(LDFLAGS) -o $@ test/hts_endian.o $(LIBS)

Expand All @@ -389,6 +404,9 @@ test/sam: test/sam.o libhts.a
test/test_bgzf: test/test_bgzf.o libhts.a
$(CC) $(LDFLAGS) -o $@ test/test_bgzf.o libhts.a -lz $(LIBS) -lpthread

test/test-ref: test/test-ref.o libhts.a
$(CC) $(LDFLAGS) -o $@ test/test-ref.o libhts.a $(LIBS) -lpthread

test/test-regidx: test/test-regidx.o libhts.a
$(CC) $(LDFLAGS) -o $@ test/test-regidx.o libhts.a $(LIBS) -lpthread

Expand All @@ -412,6 +430,7 @@ test/fieldarith.o: test/fieldarith.c config.h $(htslib_sam_h)
test/hfile.o: test/hfile.c config.h $(htslib_hfile_h) $(htslib_hts_defs_h)
test/sam.o: test/sam.c config.h $(htslib_hts_defs_h) $(htslib_sam_h) $(htslib_faidx_h) $(htslib_kstring_h)
test/test_bgzf.o: test/test_bgzf.c $(htslib_bgzf_h) $(htslib_hfile_h)
test/test-ref.o: test/test-ref.c $(htslib_bgzf_h)
test/test-regidx.o: test/test-regidx.c config.h $(htslib_regidx_h) $(hts_internal_h)
test/test_view.o: test/test_view.c config.h $(cram_h) $(htslib_sam_h)
test/test-vcf-api.o: test/test-vcf-api.c config.h $(htslib_hts_h) $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_kseq_h)
Expand Down
Loading

0 comments on commit db1c511

Please sign in to comment.