API documentation
bam
Yields records from a BAM file using pysam
DatabaseHandler
Database handler for multiprocessing.
Source code in src/fast5_rekindler/bam.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
__init__(output_dir: str, num_processes: int)
Initializes the database handler.
Source code in src/fast5_rekindler/bam.py
35 36 37 38 |
|
exit_func(worker_id: int, worker_state: Dict[str, Any]) -> None
Closes the database connection for each worker.
Source code in src/fast5_rekindler/bam.py
48 49 50 51 52 53 54 |
|
init_func(worker_id: int, worker_state: Dict[str, Any]) -> None
Initializes the database for each worker.
Source code in src/fast5_rekindler/bam.py
40 41 42 43 44 45 46 |
|
merge_databases() -> None
Merges the databases from each worker into a single database.
Source code in src/fast5_rekindler/bam.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
build_bam_db(bam_filepath: str, output_dir: str, num_processes: int) -> None
Builds a database from a BAM file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bam_filepath |
str
|
Path to the BAM file. |
required |
output_dir |
str
|
Path to the output directory. |
required |
num_processes |
int
|
Number of processes to use. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/bam.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
get_signal_info(record: pysam.AlignedSegment) -> Dict[str, Any]
Returns a dictionary containing the signal information from a BAM record.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record |
AlignedSegment
|
A BAM record. |
required |
Returns:
Name | Type | Description |
---|---|---|
signal_info |
Dict[str, Any]
|
A dictionary containing the signal information. |
Source code in src/fast5_rekindler/bam.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get_total_records(bam_filepath: str) -> int
Returns the total number of records in a BAM file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bam_filepath |
str
|
Path to the BAM file. |
required |
Returns:
Name | Type | Description |
---|---|---|
total_records |
int
|
Total number of records in the BAM file. |
Source code in src/fast5_rekindler/bam.py
99 100 101 102 103 104 105 106 107 108 109 110 |
|
insert_bamdata_in_db_worker(worker_id: int, worker_state: Dict[str, Any], bam_data: Dict[str, Any]) -> None
Inserts the signal information from a BAM record into the BAM database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker_id |
int
|
Worker ID. |
required |
worker_state |
Dict[str, Any]
|
Worker state. |
required |
bam_data |
Dict[str, Any]
|
A dictionary containing the signal information. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/bam.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
process_bam_records(bam_filepath: str) -> Generator[Dict[str, Any], None, None]
Yields records from a BAM file using pysam one-by-one and extracts the signal information from each of the record.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bam_filepath |
str
|
Path to the BAM file. |
required |
Yields:
Type | Description |
---|---|
Dict[str, Any]
|
signal_info Generator[Dict[str, Any], None, None]: A dictionary containing the signal information. |
Source code in src/fast5_rekindler/bam.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
cleanup
cleanup_fast5(fast5_filepath: str) -> None
Delete configuration groups from a FAST5 file. These groups are added automatically by ont-fast5-api but are not needed in rekindled FAST5 files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fast5_filepath |
str
|
Path to a FAST5 file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/cleanup.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
delete_configuration_groups(group: Any) -> None
Recursively delete groups named 'Configuration'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group |
Group
|
A group object. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/cleanup.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
cli
fast5_rekindler() -> None
CLI entry point for rekindle_fast5 package.
Source code in src/fast5_rekindler/cli.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
collate
DatabaseHandler
Class that handles database connections for each worker. Each worker can do READ operations in parallel for fetching BAM information for a given read_id.
Source code in src/fast5_rekindler/collate.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
__init__(database_path: str) -> None
Initializes the database path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
database_path |
str
|
Path to the database file. |
required |
Source code in src/fast5_rekindler/collate.py
24 25 26 27 28 29 30 |
|
exit_func(worker_state: Dict[str, Any]) -> None
Closes the database connection for each worker.
Source code in src/fast5_rekindler/collate.py
42 43 44 45 46 47 |
|
init_func(worker_state: Dict[str, Any]) -> None
Initializes the database connection for each worker.
Source code in src/fast5_rekindler/collate.py
38 39 40 |
|
open_database() -> Tuple[sqlite3.Cursor, sqlite3.Connection]
Connect to SQLite database (or create it if it doesn't exist)
Source code in src/fast5_rekindler/collate.py
32 33 34 35 36 |
|
add_info_to_fast5_read(f5_read: Any, data: Dict[str, Any], read_id: str) -> None
Adds basecalling information the raw FAST5 read.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f5_read |
Any
|
Raw FAST5 read object. |
required |
data |
Dict[str, Any]
|
Dictionary containing basecalling information. |
required |
read_id |
str
|
Read ID. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
|
collate_bam_fast5(bam_filepath: str, pod5_dir: str, output_dir: str, num_processes: int) -> None
Main function that combines information from BAM and all POD5 files to create legacy basecalled FAST5 files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bam_filepath |
str
|
Path to the BAM file. This file must contain moves information. |
required |
pod5_dir |
str
|
Path to the directory containing POD5 files. |
required |
output_dir |
str
|
Path to the directory where the output FAST5 files will be saved. N.B.: The POD5 directory structure will be replicated in the output directory. |
required |
num_processes |
int
|
Number of processes to use. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
|
collate_bam_fast5_worker(worker_state: Dict[str, Any], fast5_filepath: str) -> None
Worker function that fetches information from BAM file and writes it to a raw FAST5 file in order to convert it into a basecalled FAST5 file. Unfortunately, some information such as the trace table can never be recreated due to a change in the basecaller design.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker_state |
Dict[str, Any]
|
Dictionary containing the database connection and cursor. |
required |
fast5_filepath |
str
|
Path to the raw FAST5 file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
|
copy_group(source_group: Any, target_group: Any) -> None
Recursively copies a group and its contents to a target group in an HDF5 file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_group |
Any
|
HDF5 source group. |
required |
target_group |
Any
|
HDF5 arget group. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
|
create_duplex_reads_in_fast5(worker_state: Dict[str, Any], fast5_filepath: str) -> None
Creates extra reads for duplex/chimeric reads that are split into two reads in the BAM file. It copies all the information in the parent read group and renames it to the child read group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker_state |
Dict[str, Any]
|
Dictionary containing the database connection and cursor. |
required |
fast5_filepath |
str
|
Path to the raw FAST5 file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
|
delete_nonexistant_reads_from_fast5(worker_state: Dict[str, Any], fast5_filepath: str) -> None
Deletes reads that are
a. Not in the BAM file but have no corresponding record in FAST5 file b. Duplex parent reads for which with no corresponding record in BAM file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker_state |
Dict[str, Any]
|
Dictionary containing the database connection and cursor. |
required |
fast5_filepath |
str
|
Path to the raw FAST5 file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
duplicate_and_rename_group(input_file: str, original_group_name: str, new_group_name: str) -> None
Duplicates a read group in an HDF5 file and renames it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_file |
str
|
Path to the HDF5 file. |
required |
original_group_name |
str
|
Name of the original group. |
required |
new_group_name |
str
|
Name of the new group. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
|
extract_read_data_from_db_based_on_action(fast5_filepath: str, action: str, worker_state: Dict[str, Any]) -> Optional[List[Dict[str, Any]]]
Extracts information from the database for a given FAST5 file based on a given action.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fast5_filepath |
str
|
Path to the raw FAST5 file. |
required |
action |
str
|
Action to query ('duplicate' or 'delete'). |
required |
worker_state |
Dict[str, Any]
|
Dictionary containing the database connection and cursor. |
required |
Returns:
Type | Description |
---|---|
Optional[List[Dict[str, Any]]]
|
Optional[List[Dict[str, Any]]]: List of dictionaries containing BAM record information from the database. |
Source code in src/fast5_rekindler/collate.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
extract_simplex_data_from_db(id_value: str, id_type: str, worker_state: Dict[str, Any], fetch_multiple: bool = False) -> Union[Dict[str, Any], List[Dict[str, Any]], None]
Extracts information from the database for a given read ID or parent read ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_value |
str
|
Value of the read ID or parent read ID. |
required |
id_type |
str
|
Type of ID to query ('read_id' or 'parent_read_id'). |
required |
worker_state |
Dict[str, Any]
|
Dictionary containing the database connection and cursor. |
required |
fetch_multiple |
bool
|
Flag to fetch multiple records or a single record. |
False
|
Returns:
Type | Description |
---|---|
Union[Dict[str, Any], List[Dict[str, Any]], None]
|
Union[Optional[Dict[str, Any]], Generator[Dict[str, Any], None, None]]: |
Union[Dict[str, Any], List[Dict[str, Any]], None]
|
|
Union[Dict[str, Any], List[Dict[str, Any]], None]
|
|
Source code in src/fast5_rekindler/collate.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
make_fast5_files_list(directory: str) -> List[str]
Makes a list of all FAST5 files in a directory tree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory |
str
|
Path to the directory containing generated raw FAST5 files. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: List of all FAST5 file paths. |
Source code in src/fast5_rekindler/collate.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
split_hdf5_signal_array(fileobj: Any, dataset_name: str, start_idx: int, end_idx: int) -> None
Splits the raw signal array of a read into two parts and stores them in a new dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fileobj |
Any
|
File object of the HDF5 file. |
required |
dataset_name |
str
|
Name of the dataset containing the raw signal array. |
required |
start_idx |
int
|
Start index of the split. |
required |
end_idx |
int
|
End index of the split. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
|
split_raw_signal_for_duplex_reads(worker_state: Dict[str, Any], fast5_filepath: str) -> None
Splits the raw signal of a duplex read into its child reads.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
worker_state |
Dict[str, Any]
|
Dictionary containing the database connection and cursor. |
required |
fast5_filepath |
str
|
Path to the raw FAST5 file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/collate.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
|
index
DatabaseHandler
Database handler for multiprocessing.
Source code in src/fast5_rekindler/index.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
exit_func(worker_id: int, worker_state: Dict[str, Any]) -> None
Closes the database connection for each worker.
Source code in src/fast5_rekindler/index.py
30 31 32 33 34 35 36 |
|
init_func(worker_id: int, worker_state: Dict[str, Any]) -> None
Initializes the database connection for each worker.
Source code in src/fast5_rekindler/index.py
22 23 24 25 26 27 28 |
|
merge_databases() -> None
Merges the databases from each worker into a single database.
Source code in src/fast5_rekindler/index.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
build_index_db(fast5_dir: str, output_dir: str, num_processes: int) -> None
Builds an index mapping read_ids to FAST5 file paths.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fast5_dir |
str
|
Path to a FAST5 file or directory of FAST5 files. |
required |
output_dir |
str
|
Path to a output directory. |
required |
num_processes |
int
|
Number of processes to use. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/index.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
build_index_db_worker(worker_id: int, worker_state: Dict[str, Any], fast5_filepath: str) -> None
Builds an index mapping read_ids to FAST5 file paths. Every worker has its own database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fast5_filepath |
str
|
Path to a FAST5 file. |
required |
worker_id |
int
|
Worker ID. |
required |
worker_state |
Dict[str, Any]
|
Worker state dictionary. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/index.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
find_database_size(output_dir: str) -> Any
Find the number of records in the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_dir |
str
|
Path to the database directory. |
required |
Returns:
Name | Type | Description |
---|---|---|
size |
Any
|
Number of records in the database. |
Source code in src/fast5_rekindler/index.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
generate_fast5_file_paths(fast5_dir: str) -> Generator
Traverse the directory and yield all the fast5 file paths.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fast5_dir |
str
|
Path to a FAST5 file or directory of FAST5 files. |
required |
Returns:
Name | Type | Description |
---|---|---|
pod5_filepath |
str
|
Path to a FAST5 file. |
Source code in src/fast5_rekindler/index.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
get_readids(fast5_filepath: str) -> List[str]
Get a list of read_ids from a FAST5 file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fast5_filepath |
str
|
Path to a FAST5 file. |
required |
Returns:
Name | Type | Description |
---|---|---|
read_ids |
List[str]
|
List of read_ids. |
Source code in src/fast5_rekindler/index.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
prepare_data(read_ids: List[str], fast5_filepath: str) -> List[Tuple[str, str]]
Prepare tuples for read_id and fast5_filepath for insertion into database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
read_ids |
List[str]
|
List of read_ids. |
required |
fast5_filepath |
str
|
Path to a FAST5 file. |
required |
Returns:
Name | Type | Description |
---|---|---|
data |
List[Tuple[str, str]]
|
List of tuples of read_id, fast5_filepath |
List[Tuple[str, str]]
|
and other relevant read data. |
Source code in src/fast5_rekindler/index.py
78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
write_database(data: List[Tuple[str, str]], cursor: sqlite3.Cursor, conn: sqlite3.Connection) -> None
Write the index data (read_id, filepath) to the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
List[Tuple[str, str, int, int, float, int, int, int, int]]
|
List of tuples read_id and filepath |
required |
cursor |
Cursor
|
Cursor object for the database. |
required |
conn |
Connection
|
Connection object for the database. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/index.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
join_dbs
join_databases(output_dir: str) -> str
Merges the index_db and bam_db databases into a single output database fast5_bam_db.db.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_dir |
str
|
Path to the output directory. |
required |
Returns:
Name | Type | Description |
---|---|---|
output_db_path |
str
|
Path to the output database. |
Source code in src/fast5_rekindler/join_dbs.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
logger_config
configure_logger(new_log_directory: str) -> str
Configure the logger to log to a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_log_directory |
str
|
Path to the directory where the log file will be saved. |
required |
Returns:
Name | Type | Description |
---|---|---|
log_filepath |
str
|
Path to the log file. |
Source code in src/fast5_rekindler/logger_config.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
get_version() -> Any
Get the version of the app from pyproject.toml.
Returns:
Name | Type | Description |
---|---|---|
app_version |
Any
|
Version of the app. |
Source code in src/fast5_rekindler/logger_config.py
14 15 16 17 18 19 20 21 |
|
raw_fast5
convert_pod5_to_raw_fast5(input_dir: str, output_dir: str, num_processes: int = 4) -> None
Converts all pod5 files in input_dir to raw fast5 files and saves them in output_dir.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_dir |
str
|
Path to the directory containing the pod5 files. |
required |
output_dir |
str
|
Path to the output directory. |
required |
num_processes |
int
|
Number of processes to use. Default is 4. |
4
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/raw_fast5.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
convert_pod5_to_raw_fast5_worker(pod5_filepath: str, fast5_filepath: str) -> None
Converts a single pod5 file to a raw fast5 file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pod5_filepath |
str
|
Path to the pod5 file. |
required |
fast5_filepath |
str
|
Path to the output fast5 file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in src/fast5_rekindler/raw_fast5.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
get_pod5_filepath(read_id: str, db_cursor: sqlite3.Cursor) -> Any
Fetches the pod5 filepath for a given read_id from the SQLite index database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
read_id |
str
|
str The read_id of the read to be extracted. |
required |
db_cursor |
Cursor
|
sqlite3.Cursor Cursor object for the database. |
required |
Returns: pod5_filepath: str Path to the pod5 file.
Source code in src/fast5_rekindler/raw_fast5.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
make_pod5_file_list(input_dir: str, output_dir: str) -> Tuple[Iterator[Tuple[str, str]], int]
Recursively find all pod5 files (*.pod5) in input_dir and return a list of Path objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_dir |
str
|
Path to the directory containing the pod5 files. |
required |
Returns:
Name | Type | Description |
---|---|---|
pod5_file_list |
Tuple[Iterator[Tuple[str, str]], int]
|
A tuple of zipped pod5 and fast5 filepaths and total number of pod5 files. |
Source code in src/fast5_rekindler/raw_fast5.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|