From 9e732d0936336b150c98f328971e17d4b1a397d8 Mon Sep 17 00:00:00 2001 From: awjga <30524842+awjga@users.noreply.github.com> Date: Thu, 20 Dec 2018 11:32:49 +0800 Subject: [PATCH 1/2] Update nanopolish_fast5_io.cpp To remove outliers in raw signal --- src/common/nanopolish_fast5_io.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/common/nanopolish_fast5_io.cpp b/src/common/nanopolish_fast5_io.cpp index 7f387192..a13e3750 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,20 @@ 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 + // this is edited by awjga + 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 Date: Thu, 20 Dec 2018 11:42:01 +0800 Subject: [PATCH 2/2] Remove outliers from raw signal --- src/common/nanopolish_fast5_io.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/nanopolish_fast5_io.cpp b/src/common/nanopolish_fast5_io.cpp index a13e3750..7416bc60 100644 --- a/src/common/nanopolish_fast5_io.cpp +++ b/src/common/nanopolish_fast5_io.cpp @@ -134,7 +134,6 @@ raw_table fast5_get_raw_samples(hid_t hdf5_file, fast5_raw_scaling scaling) } // filter the outliers in pA - // this is edited by awjga 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){