OncoRef 1.55.0 — Multi-Species Sequence & Subtraction Speedups, HostContext.for_host, HPA v25.1 Single-Cell nCPM, and Species Catalog Polish
OncoRef 1.55.0 delivers multi-species pyensembl sequence resolution and >15× background-build speedups, promotes HostContext.for_host(...) and cross-species sex-restriction helpers with explicit pregnancy scope controls, adds in-process HPA cancer prevalence caching with canonical symbol attachment plus oncoref.dog and canine/murine representative_transcripts, and restores HPA v25.1 single-cell nCPM compatibility.
Highlights
- Multi-species sequence resolution, strict offline
autofallback, and>15×build speedups: antigen_sets._sequences()now resolves each species' pinned Ensembl release dynamically frompackaged_species_metadata(species)["reference"](Ensembl 115for human/mouse;Ensembl 98/CanFam3.1for dog), andPeptideIndex.from_sequence_bundle(..., species=...)supports"human","dog","mouse", and custom non-humanSequenceBundlearchives withoutpyensembl.sequence_source="auto"probesallow_download=Falsebefore falling back to localpyensembl(never triggering implicit asset downloads), backed bysequence_bundle.is_cached().-
Replaced ~18.4k per-gene
genome.gene_by_id(gid).transcriptsSQLite round-trips with a single bulkCDSquery joined againstprotein_sequences.fasta_dictionary(76.4s → 4.7s on230,575humanUnsafeisoforms) and replaced pandasgroupby("sequence")+.to_dict("records")inPeptideIndexwith single-pass index grouping (>35s → 1.1s). -
HostContext.for_host, cross-speciescompartments(),SEX_RESTRICTION_CODES, and pregnancy scope controls: - Promoted
host_context.from_legacy(...)toHostContext.for_host(...)andhost_context.for_host(...)(supportingmax_tpm,max_ntpm,negative_ihc_multiplier, andallow_incomplete_scope, withfrom_legacypreserved as a warning-free alias). - Exported public
host_context.compartments(species="human")andSEX_RESTRICTION_CODES = ("CTA-M", "CTA-F", "CTA-MF", "CTA-P", "RA-M-only", "RA-F-only", "RA-MF-only", "RA-P-only")(also re-exported ononcoref.antigens). -
Kept
pregnant=Truefail-closed (0eligible) by default across human, dog, and mouse becauseembryocarriesscope_complete=False(integrated early-embryo atlases lack 1st–3rd trimester fetal organogenesis coverage), documented maternal-fetal interface screening viaprotect=("placenta", "lactating_breast")(scope_complete=True,306 / 322human CTAs eligible), and added explicitallow_incomplete_scope=True(--allow-incomplete-scope) acrossHostContext,TargetFilter,antigens.*,antigen_sets.*, andoncoref antigensCLI to screen measured early-embryo + placenta + lactating RNA while still failing closed on unmeasured or>= 8TPM/nTPM exposure. -
HPA cancer prevalence caching + canonical
symbol,oncoref.dogsymmetry, and dog/mouserepresentative_transcripts: hpa_cancer_rna_prevalence(),hpa_cancer_ihc_prevalence(), andhpa_cancer_rna_ihc_comparison()now cache parsed tables in-process keyed by(path, mtime_ns, size)(returning.copy()and registering withload_dataset._clear_cache()) and attach canonical OncoRefsymbolimmediately aftergene_id(include_symbol: bool = True).- Exposed
oncoref.dog(import oncoref.dog/from oncoref import dog) as a symmetric module alias foroncoref.caninealongsideoncoref.humanandoncoref.mouse. -
Deterministically populated
representative_transcriptsacross all20,082dog (ENSCAFT*) and21,433mouse (ENSMUST*)target_selection()rows offline from compact SHA-256-verified wheel sidecars andgroup_reference_proteins(). -
HPA v25.1 single-cell
nCPMcompatibility & provenance unit: - Updated
hpa_cell_type_expression(version=None),gene_cell_type_ntpm(gene_id, *, version=None), andnormal_cell_data.observations("hpa_single_cell")to resolve both HPA v25.1'snCPMcolumn and historical v23'snTPMcolumn (recordingattrs["value_column"]and returning defensive.copy()frames), and updatedhpa_single_cellv25.1"unit"to"nCPM"inreference-releases.json.