Skip to content

Commit

Permalink
pod5 vbz integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Jenner committed Dec 14, 2023
1 parent e0d0d0f commit 7de8d96
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 155 deletions.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ CC = cc
AR = ar
SVB = thirdparty/streamvbyte
SVBLIB = $(SVB)/libstreamvbyte.a
CPPFLAGS += -I include/ -I $(SVB)/include/
# location of the modified vbz programs
# clone the fork of pod5-file-format to thirdparty/pod5-file-format
# git clone https://github.com/sashajenner/pod5-file-format thirdparty/pod5-file-format
# cd thirdparty/pod5-file-format
# git checkout svb16_clean
VBZ = thirdparty/pod5-file-format/c++/pod5_format
CPPFLAGS += -I include/ -I $(SVB)/include/ -I $(VBZ)
CFLAGS += -g -Wall -O2 -std=c99
LDFLAGS += -lm -lz
ifeq ($(zstd),1)
Expand All @@ -34,6 +40,7 @@ OBJ = $(BUILD_DIR)/slow5.o \
$(BUILD_DIR)/slow5_misc.o \
$(BUILD_DIR)/slow5_press.o \
$(BUILD_DIR)/slow5_mt.o \
$(VBZ)/signal_compression.o

PREFIX = /usr/local
VERSION = `git describe --tags`
Expand All @@ -55,6 +62,9 @@ $(SHAREDLIB): $(OBJ) $(SVBLIB)
$(SVBLIB):
make -C $(SVB) no_simd=$(no_simd) libstreamvbyte.a

$(VBZ)/signal_compression.o:
make -C $(VBZ) NO_SIMD=$(no_simd) ZSTD=$(zstd)

$(BUILD_DIR)/slow5.o: src/slow5.c src/slow5_extra.h src/slow5_idx.h src/slow5_misc.h src/klib/ksort.h $(SLOW5_H)
$(CC) $(CFLAGS) $(CPPFLAGS) $< -c -fpic -o $@

Expand All @@ -73,6 +83,7 @@ $(BUILD_DIR)/slow5_mt.o: src/slow5_mt.c include/slow5/slow5_mt.h $(SLOW5_H)
clean:
rm -rf $(OBJ) $(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
make -C $(SVB) clean
make -C $(VBZ) clean

# Delete all gitignored files (but not directories)
distclean: clean
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ To build the C/C++ library :
```sh
sudo apt-get install zlib1g-dev #install zlib development libraries
git clone https://github.com/hasindu2008/slow5lib
cd slow5lib
cd slow5lib/thirdparty
git clone https://github.com/sashajenner/pod5-file-format
cd pod5-file-format
git checkout svb16_clean
cd ../../
make
```

Expand Down
5 changes: 4 additions & 1 deletion include/slow5/slow5_press.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ extern "C" {
enum slow5_press_method {
SLOW5_COMPRESS_NONE,
SLOW5_COMPRESS_ZLIB,
SLOW5_COMPRESS_SVB_ZD, /* streamvbyte zigzag delta */
SLOW5_COMPRESS_SVB_ZD, /* 32-bit streamvbyte zigzag delta */
SLOW5_COMPRESS_ZSTD,
SLOW5_COMPRESS_VBZ, /* nanopore's pod5 vbz */
SLOW5_COMPRESS_SVB16_ZD, /* vbz without zstd, aka 16-bit streamvbyte
zigzag delta */
};
typedef struct{
enum slow5_press_method record_method;
Expand Down
Loading

0 comments on commit 7de8d96

Please sign in to comment.