poreflow.EventDataFrame¶
Bases: BaseDataFrame
Data frame storing events in a nanopore read
Data frame must contain the following columns: - i (floats): The current of an event "sfreq", "name", "bdc", "bamp", "bfreq", "ios", "channel", "start_idx",
Attributes:
| Name | Type | Description |
|---|---|---|
sfreq |
float
|
The sampling frequency |
name |
str
|
The name of the event |
bdc |
float
|
The bias voltage DC value in mV |
bamp |
float
|
The bias voltage amplitude value in mV. 0 for constant-voltage measurements |
bfreq |
float
|
The bias voltage frequency in Hz. 0 for constant-voltage measurements |
ios |
float
|
The local open-state current around the event. |
channel |
int
|
The channel number in which the event occurs. |
start_idx |
int
|
The start index in the measurement in which the event occurs. |
start_time
property
¶
The time at which the event started.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Start time of the event in seconds. |
as_dataframe()
¶
Converts the BaseDataFrame to a regular pandas DataFrame.
Returns:
| Type | Description |
|---|---|
|
pd.DataFrame: Regular pandas DataFrame without poreflow metadata. |
get_bv_period()
¶
Calculates the bias voltage period in samples.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Period of the bias voltage in samples. |
get_nyquist()
¶
Calculates the Nyquist frequency.
The Nyquist frequency is half the sampling frequency and represents the highest frequency that can be accurately represented in the signal.
Returns:
| Name | Type | Description |
|---|---|---|
float |
Nyquist frequency in Hz. |
get_t(absolute=False, n=None)
¶
Get time array
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
absolute
|
bool
|
Whether to return absolute time (start from start time). Defaults to False. |
False
|
n
|
int
|
Number of time points to return. Defaults to None, in which case an number of time points is equal to the current data is returned |
None
|
Returns:
is_varv()
¶
Checks if the measurement uses variable voltage
Returns:
| Name | Type | Description |
|---|---|---|
bool |
True if bias frequency (bfreq) is not None, indicating a variable voltage measurement. |
load(path)
classmethod
¶
reset_indices()
¶
Resets indices of data.
Resets the start_idx to the first index and resets the DataFrame index to start from 0.
Returns:
| Type | Description |
|---|---|
|
None |