From aab6381a01cb0dcd52ccab19c9407f437da2dafc Mon Sep 17 00:00:00 2001 From: Tim Massingham Date: Wed, 12 Jun 2019 10:05:25 -0700 Subject: [PATCH 1/4] Scale chunk size and overlap with stride --- bin/basecall.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/basecall.py b/bin/basecall.py index ebce5cd..47cae02 100755 --- a/bin/basecall.py +++ b/bin/basecall.py @@ -132,8 +132,8 @@ def main(): sys.exit() n_can_states = nstate_flipflop(model.sublayers[-1].nbase) stride = guess_model_stride(model) - chunk_size, chunk_overlap = basecall_helpers.round_chunk_values( - args.chunk_size, args.overlap, stride) + chunk_size = args.chunk_size * stride + chunk_overlap = args.overlap * stride sys.stderr.write("* Initializing reads file search.\n") fast5_reads = list(fast5utils.iterate_fast5_reads(args.input_folder, From 6da3084bb59f3243d4dc03534cae7060bb16a2eb Mon Sep 17 00:00:00 2001 From: Tim Massingham Date: Wed, 12 Jun 2019 10:06:35 -0700 Subject: [PATCH 2/4] Remove unused rounding code --- taiyaki/basecall_helpers.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/taiyaki/basecall_helpers.py b/taiyaki/basecall_helpers.py index dce6db9..7fa0106 100755 --- a/taiyaki/basecall_helpers.py +++ b/taiyaki/basecall_helpers.py @@ -8,13 +8,6 @@ _DEFAULT_OVERLAP = 100 -def round_chunk_values(chunk_size, chunk_overlap, stride): - # round chunk size down to nearest stride - chunk_size = (chunk_size // stride) * stride - # round chunk_overlap down to nearest stride - chunk_overlap = (chunk_overlap // stride) * stride - return chunk_size, chunk_overlap - def chunk_read(signal, chunk_size, overlap): """ Divide signal into overlapping chunks """ if len(signal) < chunk_size: From 9d8c9a389ed0f06d0489da5f62be3a317ea07fac Mon Sep 17 00:00:00 2001 From: Tim Massingham Date: Wed, 12 Jun 2019 15:46:26 -0700 Subject: [PATCH 3/4] Scale chunk size and overlap by stride in run_model --- taiyaki/basecall_helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/taiyaki/basecall_helpers.py b/taiyaki/basecall_helpers.py index 7fa0106..e6bcba8 100755 --- a/taiyaki/basecall_helpers.py +++ b/taiyaki/basecall_helpers.py @@ -70,7 +70,8 @@ def run_model( """ device = next(model.parameters()).device stride = guess_model_stride(model) - chunk_size, overlap = round_chunk_values(chunk_size, overlap, stride) + chunk_size *= stride + overlap *= stride chunks, chunk_starts, chunk_ends = chunk_read( normed_signal, chunk_size, overlap) From a132c89851bc68d26d582200cfc972c442312507 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 14 Aug 2019 10:45:37 +0100 Subject: [PATCH 4/4] Fix setup script to use list for package_data --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 76e5a2e..781fe97 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ ], packages=find_packages(exclude=["*.test", "*.test.*", "test.*", "test", "bin"]), - package_data={'configs': 'data/configs/*'}, + package_data={'configs': ['data/configs/*']}, exclude_package_data={'': ['*.hdf', '*.c', '*.h']}, ext_modules=extensions, setup_requires=["pytest-runner", "pytest-xdist"],