POD5 API Repack Reference
Tools to assist repacking pod5 data into other pod5 files
Repacker
Wrapper class around native pod5 tools to repack data
currently_open_file_reader_count
property
Returns the number of open file readers held by this repacker
add_all_reads_to_output
add_all_reads_to_output(output_ref: Pod5RepackerOutput, reader: Reader) -> None
Copy the every read from the given Reader into the
Repacker output reference which was returned by add_output
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_ref
|
Pod5RepackerOutput
|
The repacker handle reference returned from |
required |
reader
|
Reader
|
The Pod5 file reader to copy reads from |
required |
add_output
add_output(
output_file: Writer, check_duplicate_read_ids: bool = True
) -> Pod5RepackerOutput
Add an output file writer to the repacker, so it can have read data repacked into it.
Once a user has added an output, it can be passed as an output
to add_selected_reads_to_output or add_reads_to_output
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_file
|
Writer
|
The output file writer to use |
required |
check_duplicate_read_ids
|
bool
|
Check the output for duplicate read ids, and raise an error if found. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
repacker_object |
Pod5RepackerOutput
|
Use this as |
add_selected_reads_to_output
add_selected_reads_to_output(
output_ref: Pod5RepackerOutput, reader: Reader, selected_read_ids: Collection[str]
)
Copy the selected read_ids from the given Reader into the
Repacker output reference which was returned by add_output
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_ref
|
Pod5RepackerOutput
|
The repacker handle reference returned from |
required |
reader
|
Reader
|
The Pod5 file reader to copy reads from |
required |
selected_read_ids
|
Collection[str]
|
A Collection of read_ids as strings |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If any of the selected_read_ids were not found in the source file |
finish
Call finish on the underlying c_api repacker instance to write the footer completing the file and freeing resources