diff --git a/src/common/nanopolish_fast5_io.cpp b/src/common/nanopolish_fast5_io.cpp index 7f387192..7416bc60 100644 --- a/src/common/nanopolish_fast5_io.cpp +++ b/src/common/nanopolish_fast5_io.cpp @@ -92,7 +92,8 @@ raw_table fast5_get_raw_samples(hid_t hdf5_file, fast5_raw_scaling scaling) herr_t status; float raw_unit; raw_table rawtbl = { 0, 0, 0, NULL }; - + size_t tmp_nsample; + // mostly from scrappie std::string raw_read_group = fast5_get_raw_read_group(hdf5_file); @@ -132,6 +133,19 @@ raw_table fast5_get_raw_samples(hid_t hdf5_file, fast5_raw_scaling scaling) rawptr[i] = (rawptr[i] + scaling.offset) * raw_unit; } + // filter the outliers in pA + for (size_t i = nsample-1; i >0 ; i--) { + //filter sample > 200 pA and less than 0 pA + if(rawptr[i]>200 || rawptr[i]<0){ + tmp_nsample=tmp_nsample-1; + for (size_t dd=i;dd