End-Motif Counts
cfdna ends writes <prefix>.end_motifs.zarr. Load dense or sparse end-motif count Zarr stores and extract motif count tables, dense arrays, or sparse matrices.
This is loader API documentation, not command-line help. See cfdna ends for command flags and output generation.
Quick Use
- Python
- R
import cfdnalab as cfl
ends = cfl.read_end_motifs("sample.end_motifs.zarr")
storage = ends.storage_mode()
row_mode = ends.row_mode()
motifs = ends.motifs_metadata()
motif_counts = ends.data_frame(motifs="_AA")
motif_matrix = ends.sparse_counts_matrix(motifs="_AA")
library(cfdnalab)
ends <- read_end_motifs("sample.end_motifs.zarr")
storage <- storage_mode(ends)
row_mode <- row_mode(ends)
motif_table <- motifs(ends)
motif_counts <- end_motif_data_frame(ends, motifs = "_AA")
motif_matrix <- sparse_counts_matrix(ends, motifs = "_AA")
Notes
- Sparse stores stay sparse unless a dense helper explicitly receives a densify option.
- Windowed and grouped outputs can filter rows by
max_blacklisted_fraction.
Function Index
- Python
- R
| Symbol | Type | Summary |
|---|---|---|
read_end_motifs | function | Open a cfDNAlab end-motif count Zarr store. |
EndMotifCounts | class | Common API for global, windowed, and grouped end-motif outputs. |
GlobalEndMotifCounts | class | End-motif counts for global output. |
WindowedEndMotifCounts | class | End-motif counts for fixed-size or BED-window output. |
GroupedEndMotifCounts | class | End-motif counts for grouped BED output. |
Full details: Python API.
| Topic | Summary |
|---|---|
read_end_motifs | Loads a <prefix>.end_motifs.zarr store created with the cfdna ends CLI tool from the main cfDNAlab rust package. |
storage_mode | Return the end-motif storage mode. |
row_mode | Return the end-motif row mode. |
motifs | For ordinary end-motif stores, the motif column contains concrete motif labels. |
motif_idx | Look up a motif index. |
has_motif | Test whether an end-motif label exists. |
window_metadata | Return window metadata. |
group_metadata | Return group metadata. |
group_idx | Look up a group index. |
end_motif_data_frame | Sparse outputs return stored non-zero rows unless the method explicitly receives densify = TRUE. |
dense_counts_matrix | Sparse stores are not densified unless the method explicitly receives allow_densify = TRUE. |
dense_counts_vector | Sparse stores are not densified unless the method explicitly receives allow_densify = TRUE. |
sparse_counts_matrix | Sparse stores are converted directly from their stored COO arrays. |
schema_version | Return the cfDNAlab schema version. |
Full details: R API.