Skip to content

Commit 2fde341

Browse files
thequicksortJessica Dunstankdoroschak
authored and
Jessica Dunstan
committed
[#83] Introduce abstractions for signals and fast5 files (#84)
* [#83] Introduce abstractions for signals and fast5 files * Removed class method from FractionalizedSignal * Architecting signal and fast5 data organization Co-authored-by: Jessica Dunstan <[email protected]> Co-authored-by: Katie Doroschak <[email protected]>
1 parent 7eb26ee commit 2fde341

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

poretitioner/fast5s.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Classes for reading, writing and validating fast5 files.
77
"""
88

9-
from dataclasses import dataclass
109
from os import PathLike
1110
from pathlib import Path, PurePosixPath
1211
from typing import List, NewType, Optional, Union
@@ -21,14 +20,14 @@
2120
RawSignal,
2221
VoltageSignal,
2322
)
23+
2424
from .utils.classify import (
2525
NULL_CLASSIFICATION_RESULT,
2626
ClassificationResult,
2727
ClassifierConfiguration,
2828
ClassifierDetails,
2929
NullClassificationResult,
3030
)
31-
from .utils.core import NumpyArrayLike
3231

3332
__all__ = ["BulkFile", "CaptureFile", "channel_path_for_read_id", "signal_path_for_read_id"]
3433

@@ -348,7 +347,7 @@ def get_voltage(self, start=None, end=None) -> VoltageSignal:
348347
349348
Returns
350349
-------
351-
NumpyArrayLike[int]
350+
VoltageSignal[int]
352351
Voltage(s) in millivolts (mV).
353352
"""
354353
bias_voltage_multiplier = 5 # Signal changes in increments of 5 mV.

tests/test_signals.py

+6
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ def can_serialize_test(self):
180180
class TestPicoampereSignal:
181181
def signal_converts_to_fractionalized_test(self):
182182
pico = PicoampereSignal(PICO_SIGNAL, CHANNEL_NUMBER, CALIBRATION)
183+
median = np.median(pico)
184+
185+
expected = compute_fractional_blockage(pico, median)
186+
frac = raw.to_fractionalized()
187+
assert np.isclose(frac, expected), "Fractionalized current should match expected."
188+
183189

184190
class PicoampereSignalTest:
185191
def __init__(self):

0 commit comments

Comments
 (0)