Skip to main content

Length Counts

cfdna lengths writes <prefix>.length_counts.tsv.zst. Load fragment length-count TSV outputs and return counts, fractions, or densities as arrays, matrices, vectors, or data frames.

This is loader API documentation, not command-line help. See cfdna lengths for command flags and output generation.

Quick Use

import cfdnalab as cfl

lengths = cfl.read_lengths("sample.length_counts.tsv.zst")

bins = lengths.length_bins()
counts = lengths.counts_array(with_length_range=(100, 221))
fractions = lengths.data_frame(value="fraction")

Notes

  • Use with_lengths, with_length_range, or direct length-bin indices to select bins.
  • For fractions and densities, denominator controls whether totals use all bins or selected bins.

Function Index

SymbolTypeSummary
read_lengthsfunctionRead a cfDNAlab length-count TSV and return the matching loader class.
LengthCountsclassCommon API for global, windowed, and grouped length-count outputs.
GlobalLengthCountsclassLength counts for global output.
WindowedLengthCountsclassLength counts for fixed-size or BED-window output.
GroupedLengthCountsclassLength counts for grouped BED output.

Full details: Python API.