From 6e6ad462066d583b4dd198f7804d8d6018b2d903 Mon Sep 17 00:00:00 2001 From: Katie Doroschak Date: Tue, 16 Mar 2021 21:39:17 -0700 Subject: [PATCH] judge channels implemented --- src/poretitioner/utils/segment.py | 8 ++++++++ src/tests/test_segment.py | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/poretitioner/utils/segment.py b/src/poretitioner/utils/segment.py index 8ccc9a1..1da5bdd 100644 --- a/src/poretitioner/utils/segment.py +++ b/src/poretitioner/utils/segment.py @@ -393,6 +393,14 @@ def segment( local_logger.debug( f"Segmenting configuration '{bulk_f5_filepath}' and saving results at location '{save_location}' " ) + good_channels = judge_channels( + bulk_f5_filepath, + segment_config.open_channel_prior_mean, + segment_config.open_channel_prior_stdv, + ) + + object.__setattr__(segment_config, "good_channels", good_channels) + return parallel_find_captures( config, segment_config, diff --git a/src/tests/test_segment.py b/src/tests/test_segment.py index 700d28c..77d5671 100644 --- a/src/tests/test_segment.py +++ b/src/tests/test_segment.py @@ -611,7 +611,6 @@ def prep_capture_windows_test(): assert count_by_channel[channel_number] == 4 -@pytest.mark.xfail(reason="Need to implement config (filters currently in progress).") class TestParallelFindCaptures: def parallel_find_captures_test(self): bulk_f5_fname = "src/tests/data/bulk_fast5_dummy.fast5" @@ -735,7 +734,11 @@ def segment_test(self): "translocation_delay": 20, "open_channel_prior_mean": 220, "open_channel_prior_stdv": 50, - "good_channels": [1, 3], + "good_channels": [ + 1, + 2, + 3, + ], # this will be internally overwritten by the good channels calculation, which should not include channel 2 "end_tolerance": 50, "terminal_capture_only": False, "n_captures_per_file": 1000,