registry.ClockRegistry
registry.ClockRegistry(clocks, version, path)Loaded catalogue. Immutable except for user-registered local weights.
Methods
| Name | Description |
|---|---|
| coefficients | Feature ids and coefficients, in the file’s order. |
| compatible_with | Clocks this dataset can actually be scored on. |
| deconvolution_table | The reference table (CpGs x cell types) a deconvolution entry reads. |
| filter | Exact-match filter; tuple-valued fields match on membership. |
| has_coefficient_vector | True when this clock has one weight per feature to hand out. |
| import_dunedinpace | Register DunedinPACE from the authors’ R package (installed, a source |
| import_pc_clocks | Register the PC clocks from the authors’ CalcAllPCClocks.RData. |
| intercept | The constant a coefficient file carries as an (Intercept) row. |
| pace_model | The weights, background means and model means DunedinPACE scores with. |
| quadratic_model | A model with squared-CpG terms (cAge): base CpGs, a frame of their |
| reference_label | What a warning calls the clock’s reference values, or None. |
| reference_values | The clock’s per-feature fill values, or None when it has none. |
| register_local_reference | Fill values for the absent features of a clock whose weights the user |
| register_local_weights | Supply a coefficient file the package does not distribute. |
| search | Substring match over id, name, predicts, notes and citation. |
| unavailable_message | The text a user sees when a clock cannot be scored. Worth care. |
| untraced | Clocks whose coefficients have no established primary source. |
| weight_record | What the run manifest records about this clock’s coefficients. |
coefficients
registry.ClockRegistry.coefficients(clock_id)Feature ids and coefficients, in the file’s order.
Raises
| Name | Type | Description |
|---|---|---|
| WeightsUnavailableError | For a licensed clock with nothing registered, or an untraced clock whose fetch has not happened. The message names the remedy. |
compatible_with
registry.ClockRegistry.compatible_with(data, *, min_coverage=0.8)Clocks this dataset can actually be scored on.
Compatibility is coverage, not platform. A clock trained on 450K runs perfectly well on EPIC data that happens to carry its probes, and fails on 450K data that has been filtered down to 20,000 probes. Only the feature list can answer the question, so bundled clocks are checked against it and the rest are reported by declared platform, with the difference made explicit in the reason string.
deconvolution_table
registry.ClockRegistry.deconvolution_table(
clock_id,
platform=None,
present=None,
)The reference table (CpGs x cell types) a deconvolution entry reads.
The table declared for platform; otherwise, when present (the data’s feature ids) is given, the one the data covers best; otherwise the first. A table the user registered for a licensed entry wins.
filter
registry.ClockRegistry.filter(**criteria)Exact-match filter; tuple-valued fields match on membership.
reg.filter(availability=“bundled”, scale_type=“age_years”)
has_coefficient_vector
registry.ClockRegistry.has_coefficient_vector(clock_id)True when this clock has one weight per feature to hand out.
False for a network, whose weights are layer matrices. The distinction matters to anything that squares a weight or sums the absolute weights: those operations are defined on a linear model and have no counterpart in a five-layer network. False too for a deconvolution entry, whose parameters are a table of cell-type means.
import_dunedinpace
registry.ClockRegistry.import_dunedinpace(path, out_dir=None)Register DunedinPACE from the authors’ R package (installed, a source checkout, or its sysdata.rda).
See :func:falconage.registry.pace_import.import_dunedinpace.
import_pc_clocks
registry.ClockRegistry.import_pc_clocks(path, out_dir=None)Register the PC clocks from the authors’ CalcAllPCClocks.RData.
See :func:falconage.registry.pc_import.import_pc_clocks.
intercept
registry.ClockRegistry.intercept(clock_id)The constant a coefficient file carries as an (Intercept) row.
None of the bundled files has one; their constants are add steps in the registry. A file a user registers often does, and without this the row would be aligned as a CpG the data lacks and filled.
pace_model
registry.ClockRegistry.pace_model(clock_id)The weights, background means and model means DunedinPACE scores with.
quadratic_model
registry.ClockRegistry.quadratic_model(clock_id)A model with squared-CpG terms (cAge): base CpGs, a frame of their linear and squared weights in each of its two models, and the two intercepts. See :mod:falconage.models.quadratic.
reference_label
registry.ClockRegistry.reference_label(clock_id)What a warning calls the clock’s reference values, or None.
reference_values
registry.ClockRegistry.reference_values(clock_id)The clock’s per-feature fill values, or None when it has none.
register_local_reference
registry.ClockRegistry.register_local_reference(clock_id, values)Fill values for the absent features of a clock whose weights the user supplied, as the clock’s authors publish them (a mapping or a two-column feature_id,value file). Used exactly as a bundled reference is.
register_local_weights
registry.ClockRegistry.register_local_weights(clock_id, path, sha256=None)Supply a coefficient file the package does not distribute.
Validates against the scaffold – two columns, no duplicate feature ids, finite values, and the declared feature count when the registry has one. A file that does not match is rejected with the mismatch named, which also makes this the way to check a coefficient set somebody handed you.
Returns the SHA-256 of the accepted file; it goes into the run manifest as weights_source: user_supplied, so a result computed from a licensed copy is distinguishable from one computed from a redistributed set.
search
registry.ClockRegistry.search(term)Substring match over id, name, predicts, notes and citation.
untraced
registry.ClockRegistry.untraced()Clocks whose coefficients have no established primary source.
weight_record
registry.ClockRegistry.weight_record(clock_id)What the run manifest records about this clock’s coefficients.