Skip to main content

biocognia-markers

The marker graph that SCIMAP Pro, Plexora and other BioCognia products share.

  • Nodes: markers and cell families.
  • Edges: what is known about them: exceptions, exclusions, subsets, carriers and co-expression.
  • Evidence: the evidence behind each node and edge.
  • Verification: an item counts as verified only when a machine has found every part of it in its source (biocognia-markers verify).
import biocognia_markers as bm

graph = bm.load()                       # the shipped graph, with the user's overlay laid over it
graph.resolve(["CD3e", "PD-1"])
graph.edges_of("m:pd1")

Phenotyping from it

from biocognia_markers import phenotypes, inference

defs = phenotypes.definitions(["CD45", "CD3e", "CD8a", "FOXP3"], context="melanoma")
defs["coverage"]["types"]                # what this panel can resolve, and what would recover the rest
inference.evaluate(defs, {"CD45": 0.9, "CD3e": 0.8, "CD8a": 0.9})   # one cell: type, outcome, reason, confidence

phenotypes turns the graph and a panel into definitions; inference is the one engine every product runs on them (SCIMAP Pro's tl.autoPhenotype streams cells through it): one decision per pattern of positive, negative and unmeasured markers. A cell positive for two lineages the graph keeps apart climbs a ladder (spill from a neighbour, unmixing on linear intensities, relative strength, its spatial and expression neighbours) and, when nothing settles it, gets the best guess. Named functional states live in the graph's states section (schema 2), how a transcript reads each marker in its rna field.

Your own cell types

from biocognia_markers import workflow

text = workflow.text_of(workflow.from_definitions(defs))     # the knowledge base's types, one bare name per line
defs = workflow.compile("""
Immune: CD45+
    T cell: CD3+
        CD4 T cell: CD4+
    Macrophage: (CD68+ or CD163+), CD3-, CD4±
""", channels)
workflow.check(text, channels)                                # every problem, with its line

+ has, - lacks, ± may also have, ? if measured, or any of, indentation inside. A line with markers compiles to require on its type and is held strictly by the engine (strict): no final label breaks it or an ancestor's line. A bare name is the knowledge base's type, weighed as in automatic mode, and a workflow of bare names only compiles to the automatic document itself. A written negative is judged after the absolute spill test (strict.waivers). A document without require is decided exactly as before.

An optional relations: block (CD3 needs CD45, CD8 suggests CD3 unless NK cell, MART1 supports SOX10) says which markers' cells carry which others; the knowledge base also proposes them from the tree (inferred). They matter only to uncertainty-aware calls (uncertainty: zones around the gates from reference populations; uncertainty.check_relations keeps an inferred relation only where the data agree), where a clearly positive deeper marker may stand for an inherited marker just below its gate.

Changing it safely

Every write to an overlay is validated first (bm.validate.validate, a dry run: schema, unknown names, duplicates, contradictions) and journaled beside it (bm.overlay.history, at, revert). A write never brings a citation with it; only verify earns one. Graph.fingerprint(used) records what a result rested on, and bm.graph.compare says later which of those items changed.

See the graph

biocognia-markers view          # the live graph (shipped + your overlays), opened in a browser

The page shows every marker, family and relation, with the quotes behind each; search it by any name a panel uses, filter by relation, confidence or tissue, or read the relations as a table. It is written beside your overlay, and every change to the graph through this package rewrites it, so reloading the tab shows the current graph. bm.view.write(path) writes it anywhere.

On GitHub, docs/graph.html is the page of the shipped graph at that commit: download it (Raw, then save) and open the file. biocognia-markers merge and verify --write rewrite it when they change the shipped graph; after a hand edit, run biocognia-markers view --shipped --out docs/graph.html --no-open (the tests fail until you do).

Adding to it

To add to the graph, an agent follows the skill biocognia-marker-graph (src/biocognia_markers/skills/marker-graph/SKILL.md). tools/migrate.py built the first graph from SCIMAP Pro's rule library and Plexora's vocabulary. Where those two sources disagree is listed in MIGRATION_REPORT.md.

Metadata

Release files for biocognia-markers 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for biocognia-markers 0.2.6
File Size Uploaded Provenance Actions
biocognia_markers-0.2.6.tar.gz 2.4 MB Without provenance Details for biocognia_markers-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for biocognia-markers 0.2.6
File Interpreter ABI Platform Actions
biocognia_markers-0.2.6-py3-none-any.whl Python 3 none any Details for biocognia_markers-0.2.6-py3-none-any.whl

Total release size: 3.7 MB

Release files / biocognia_markers-0.2.6.tar.gz

Download URL biocognia_markers-0.2.6.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d0f8974264d74b2d4a730583af99cc03b9417e79ce72b3bedf052bbd9e73aed3
BLAKE2b-256 checksum
How to use checksums
cfdfa0be97c3042b815fa7adab0316dae765b5a2e5ab2ef4d3d61aba6b3457d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release files / biocognia_markers-0.2.6-py3-none-any.whl

Download URL biocognia_markers-0.2.6-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a853c3d8ba5b59c1d7570786349fcc611bad1adc543bfd27c6b223fd11e05360
BLAKE2b-256 checksum
How to use checksums
99ddf65133ef707f2cc1cac264012804d07e42ff5240939c534c4ac0f39f7f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Security for biocognia-markers 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page