smftools.informatics.pod5_functions#
Functions
|
Basecall POD5 inputs using a configuration file. |
|
Extract per-read POD5 sequencing + signal metadata into a DataFrame. |
|
Convert FAST5 inputs into a single POD5 file. |
|
Yield |
|
Write a subsampled POD5 containing selected reads. |
|
Randomly sample up to max_reads reads from pod5 inputs and write a temp pod5. |
- smftools.informatics.pod5_functions.basecall_pod5s(config_path)#
Basecall POD5 inputs using a configuration file.
- smftools.informatics.pod5_functions.fast5_to_pod5(fast5_dir, output_pod5='FAST5s_to_POD5.pod5')#
Convert FAST5 inputs into a single POD5 file.
- Parameters:
- Raises:
FileNotFoundError -- If no FAST5 files are found or the input path is invalid.
- Return type:
- smftools.informatics.pod5_functions.subsample_pod5(pod5_path, read_name_path, output_directory)#
Write a subsampled POD5 containing selected reads.
- Parameters:
- Return type:
- smftools.informatics.pod5_functions.subsample_pod5_for_basecalling(input_path, max_reads, output_dir, seed=42)#
Randomly sample up to max_reads reads from pod5 inputs and write a temp pod5.
Collects read IDs from all pod5 files first (memory-efficient), then samples, then writes only the selected reads. If the total read count is already <= max_reads the original input_path is returned unchanged.
- Parameters:
- Return type:
- Returns:
Path to the (possibly new) pod5 file to use for basecalling.
- smftools.informatics.pod5_functions.iter_pod5_signals(pod5_path_or_dir, read_ids=None, *, pattern='*.pod5', calibrated=True)#
Yield
(read_id, signal)for selected reads across POD5 file(s).- Parameters:
pod5_path_or_dir (
str|Path) -- A POD5 file or a directory of POD5 files.read_ids (
Optional[Iterable[str]] (default:None)) -- Optional read ids to fetch (defaults to all reads).pattern (
str(default:'*.pod5')) -- Glob for POD5 files when a directory is given.calibrated (
bool(default:True)) -- Yieldsignal_pa(picoamps) when True, else raw DAC signal.
- Yields:
(read_id, numpy.ndarray)one read at a time (bounded memory).
- smftools.informatics.pod5_functions.extract_pod5_read_metadata(pod5_path_or_dir, target_ids=None, *, pattern='*.pod5', n_jobs=1, include_current=False, verbose=True)#
Extract per-read POD5 sequencing + signal metadata into a DataFrame.
Links each read to its origin POD5 and captures scalar run/pore/signal metadata (channel, well, calibration, median_before, sample_rate, flow cell, kit, etc.). The full current trace is only included when
include_currentis True and is left in the returned frame aspod5_current_pa(ragged); it is never promoted to the spine.- Parameters:
pod5_path_or_dir (
str|Path) -- A POD5 file or a directory of POD5 files.target_ids (
Optional[Iterable[str]] (default:None)) -- Optional read ids to keep (defaults to all reads).pattern (
str(default:'*.pod5')) -- Glob for POD5 files when a directory is given.n_jobs (
int|None(default:1)) -- Worker processes; <=1 runs serially.include_current (
bool(default:False)) -- Also capture the calibrated current trace per read.verbose (
bool(default:True)) -- Log progress.
- Returns:
pandas.DataFrame indexed by
read_id(empty if no reads matched).