Building a cohort
A cohort is a short document: what to count, the criteria each counted record must meet, and which concept mappings to trust. This page explains each part and what the node does with it.
What a definition holds
| Part | Meaning |
|---|---|
| Name and version | A version never changes. Defining the name again with other criteria makes the next version. |
| Unit | The one record type it counts: Subject, Specimen, Extract, Library, Pool, SequencingRun, AnalysisRun, DataFile or DataFileSet. Every version of a name keeps it. |
| Criteria | One criterion, which may combine others (below). |
| Mapping policy | Which concept mappings to follow: a minimum confidence, methods, kinds of match. By default, every exact mapping. |
| Identity | Optional: records joined by a same-as link of at least this confidence count once. Without it, records are counted. |
| Purpose | Free text saying why. |
| Owner and state | The department that defined it, who did, and whether it is active or retracted. A retracted version stays as the record of past evaluations. |
Criteria
A criterion is true or not of the record it is evaluated at: the unit, or a record a lineage step reached. Criteria nest:
Counting Subjects
all · all of
harmoniomics-concept:sex is femaledownstream · something made from it: a Library
upstream · which used a Reagent
entity · the lot LOT-L
As the node stores it
{"all": [
{"concept": "harmoniomics-concept:sex",
"members": ["female"]},
{"downstream": "Library",
"where": {"upstream": "Reagent",
"where": {"entity": "LOT-L"}}}
]}| Criterion | True when |
|---|---|
all, any, not | Every one, some one, or not the one inside it is. |
| Concept and members | Some value of the concept is one of these members (or a recorded absence). |
| Concept and a range | Some value, in the concept’s unit, is within the bounds. |
| Concept present | The record has a value of the concept, or, asked the other way, has none at an institution that records it. |
upstream, downstream | Some record of that type that its material or data came from, or that was made from it, at any depth, meets the inner criterion. |
path | Some record at the end of these exact links meets the inner criterion. |
in_context | The record is part of this family, cohort or study, optionally in a given role. |
in_project | The record is one of the project’s members, or was made from one: what selecting the project in Explore shows. |
field | Some value of one of the node’s own facet fields, compared as stored, passes a test. A cohort reads only fields in the node’s index. |
entity | The record is this one, such as a kit lot. |
A concept or field marked as patient data is never a criterion. The same criteria find records in Explore, one by one (searching your node). A concept criterion is rewritten into each institution’s own spellings and units through its mappings, exactly as a search by concept is.
How lineage flows
Material and data flow from a parent to what is derived from it, from a library into the pool it joined, from an input into what used it, and from a run into what it produced. A record that names its own parents takes its material from them alone:
So a kit lot flows into the libraries made with it, not into the people: “subjects whose material went through lot L” asks for subjects with a library downstream that used the lot, as in the tree above. Projects and families are groupings, not steps: reach a family with in_context, a project with in_project.
True, false or unknown
A department with no field for sex cannot say a subject is not female. Every criterion is true, false or unknown for each record, and a record counts only when its whole criterion is true:
| Subject | Recorded | “female” | “not female” |
|---|---|---|---|
| S-01 | female | true | false |
| S-02 | male | false | true |
| S-03 | no value | unknown | unknown |
| S-04 | field not mapped to the concept | unknown | unknown |
| Counted | 1 | 1 | |
| Unknown | 2 | 2 | |
“Not female” never counts a subject whose sex nobody recorded.
- A concept criterion is unknown where the institution has no field mapped to the concept, where the record has no value, or where its only values have no mapping yet.
- A lineage criterion is unknown when no record it reaches is true and some are unknown. Reaching none is false: the graph is the record of what was made.
- A department the asker cannot see is never counted as false either. Its records are outside the answer, and the answer says which departments it would need.
The answer
An evaluation answers, for each institution and department it covers: the records counted, those unknown, and the total of the unit’s type. Optionally, it breaks the count down by up to two of:
- the members of a coded concept, plus missing and unknown;
- bins of a number concept, in its unit;
- the records of a type it reaches upstream or downstream, by name, such as kit lots or runs.
A record with several values counts in each of its groups, so groups can overlap; the answer says so and never adds them up. For each concept, the answer names the fields and mappings that answered it, how many records have a value, and flags where values were not mapped, were converted to the concept’s unit, or came from fields that convert differently.
Small counts are withheld
| Counted | Shown | |
|---|---|---|
| Blood | 27 | 27 |
| Saliva | 12 | supp.2 |
| Buccal swab | 3 | supp.1 |
| Tissue | 0 | 03 |
| Total | 42 | 42 |
- 13 is between 1 and 4: withheld.
- 2With the total shown, 42 − 27 − 0 would give the 3 away, so the next smallest, 12, is withheld too.
- 30 is shown: nothing is learnt from nobody.
The same rule as everywhere else on the node: counts from 1 to 4 are withheld, and one more when a total would give one away. It applies to your own people too.
Members, for your own people only
A department’s own people can list the members counted, by name, a page at a time. That list never leaves the node, and listing it is recorded too: how many names, never the names.
Across your departments
A cohort is evaluated for the department that asks, over every department whose aggregates it may count: its own, and those that granted it aggregates. A grant of aggregates lets the node count the owner’s records, read their values and follow their lineage for the evaluation, and show none of it.