POD5 API Writer Reference
Tools for writing POD5 data
SignalType
module-attribute
The type of compression applied to a signal SignalType::{UncompressedSignal, VbzSignal}
Writer
Writer(
path: PathOrStr,
software_name: str = DEFAULT_SOFTWARE_NAME,
signal_compression_type: SignalType = VbzSignal,
)
Pod5 File Writer
Open a pod5 file for Writing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
(PathLike, str)
|
The path to the pod5 file to create |
required |
software_name
|
str
|
The name of the application used to create this pod5 file |
DEFAULT_SOFTWARE_NAME
|
signal_compression_type
|
SignalType
|
The type of compression to use in the file. Defaults to Vbz. |
VbzSignal
|
signal_compression_type
property
signal_compression_type: SignalType
Return the signal compression type used by this file
add
Add a EndReason, PoreType, or
RunInfo object to the Pod5 file (if it doesn't already
exist) and return the index of this object in the Pod5 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Union[EndReason, PoreType, RunInfo]
|
Object to find in this Pod5 file, adding it if it doesn't exist already |
required |
Returns:
| Name | Type | Description |
|---|---|---|
index |
int
|
The index of the object in the Pod5 file |
add_read
add_read(read: Union[Read, CompressedRead]) -> None
Add a record to the open POD5 file with either compressed or uncompressed signal data depending on the given type of Read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
read
|
Union[Read, CompressedRead]
|
POD5 |
required |
add_reads
add_reads(reads: Sequence[Union[Read, CompressedRead]]) -> None
Add Read objects (with uncompressed signal data) as records in the open POD5 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reads
|
Sequence[Union[Read, CompressedRead]
|
Sequence of Read or CompressedRead objects to be added to this POD5 file |
required |
contains
find
Returns the index of obj in this Pod5 file raising a KeyError if it is missing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Union[EndReason, RunInfo]
|
Obj instance to find in this Pod5 file |
required |
Returns:
| Type | Description |
|---|---|
int
|
The index of the object in this Pod5 file |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the object is not in this file |
map_to_tuples
Convert a fast5 property map (e.g. context_tags and tracking_id) to a tuple or string pairs to pass to pod5 C API