Tutorials › Multi-Omics Data Integration › Subjects, Assays, and Cohorts as Design Units

Study Designs for Integration · Tutorial 16 of 597

Subjects, Assays, and Cohorts as Design Units

Learn to tell subjects, samples, assays, and cohorts apart, and use explicit records to describe the links among them.

Intermediate 9 min read

What You'll Learn

  • Define subject, sample, assay instance, and cohort as distinct design units.
  • Distinguish a physical sample from the assay that measures it.
  • Read sample-to-assay records without treating assay rows as unique subjects.
  • Count distinct subjects, samples, assays, and cohorts from a record table.
  • Identify metadata and identifier problems that can obscure unit relationships.

Why Design Units Need Separate Names

An integration study may have data tables whose rows represent different things. A row in a clinical table may describe a person, while a row in an assay manifest may describe a specimen, aliquot, or measurement run. Treating every row as one “sample” can conceal how many people were studied and which measurements come from the same biological material. Before interpreting a multi-omics data set, identify the units and record the links between them.

The earlier material on sample-by-feature matrices describes how measurements are arranged within an assay. Here the focus is the structure around those measurements: who or what was studied, which biological material was collected, which assay events produced data, and which study group the subject belongs to. These distinctions are about design and provenance, not about the biological interpretation of particular features.

Definition: A subject is the biological entity about which the study seeks information, commonly a person, animal, or cell donor. A sample is a collected biological specimen or a tracked portion of one, such as a tissue specimen, blood draw, or aliquot. An assay is a defined measurement event applied to a sample under a specified assay type or protocol. A cohort is a specified group of subjects assembled under a study, recruitment, or sampling definition.

These units are not interchangeable. A subject can contribute multiple samples, for example when blood is collected at two visits. A sample can be split into aliquots, and different aliquots can be used for different assays. An assay can also be repeated on the same sample, for example as a technical replicate. A cohort is a group of subjects; it is not a sample, a measurement table, or a single assay.

The word sample is often used informally to mean a row in a data matrix. In a design record, make its meaning explicit. A physical specimen or aliquot is different from the assay instance performed on it, and both differ from the subject who provided the material. If a study uses “sample” to mean an assay-ready aliquot, document that convention rather than silently switching between meanings.

Representing the Links in Records

A practical record system gives each unit an identifier and stores the relationships between units explicitly. The following fields are common: a subject identifier, a cohort identifier, a sample identifier, an assay identifier, and an assay type. Additional fields may record collection time, tissue, aliquot, assay run, or processing details. Such fields describe provenance; they should not be inferred merely from a data-table row number.

Record or tableOne row representsExample identifiers or fields
Subject registryOne enrolled biological subjectsubject_id, cohort_id
Sample manifestOne collected specimen or tracked portionsample_id, subject_id, collection_time, tissue
Assay manifestOne assay instance applied to a sampleassay_id, sample_id, assay_type, run
Feature tableMeasurements for features under a stated assay-sample conventionsample or assay identifier, feature columns

The table is a conceptual guide, not a requirement that all data be stored in separate files. The essential point is that each record has a defined unit and that links use identifiers with stated meanings. For example, if the assay manifest records which sample each assay used, then the sample manifest can identify the subject associated with that sample. Following these links establishes which subject is represented by an assay record.

Key rule: An identifier should identify one unit within its stated scope. A subject identifier identifies a subject, a sample identifier identifies a sample, and an assay identifier identifies an assay instance. Reusing one identifier to stand for different unit types makes the relationships ambiguous.

Cohort membership is generally recorded at the subject level. A sample or assay can be associated with a cohort by following its subject link, provided cohort membership is defined and recorded for that subject. A cohort label should not be assigned from a file name or assay batch unless the study documentation establishes that relationship. Cohorts may be defined by recruitment source, study protocol, or other explicit criteria; the label alone does not explain those criteria.

Worked Example: Counting Units in a Sample-to-Assay Manifest

Suppose a hypothetical study has the following records. Each assay identifier denotes one assay instance, and each listed sample identifier denotes one tracked specimen portion.

subject_idcohort_idsample_idassay_idassay_type
P01CedarS01A01RNA sequencing
P01CedarS01A02protein assay
P02CedarS02A03RNA sequencing
P03MapleS03A04RNA sequencing
P03MapleS04A05protein assay

The manifest has five assay records, so the number of listed assay instances is \(5\). Its distinct subject identifiers are P01, P02, and P03, giving \(3\) subjects. The distinct sample identifiers are S01, S02, S03, and S04, giving \(4\) samples. The distinct cohort identifiers are Cedar and Maple, giving \(2\) cohort labels.

P01 has two assay records that point to sample S01; the records therefore describe two assay instances applied to the same tracked sample. P03 has two assay records linked to two different sample identifiers. These are different relationships, even though both subjects appear twice in the assay manifest. The counts follow from the unit identifiers, not from the number of rows alone.

This interpretation assumes that each assay_id is unique to one assay instance, each sample_id is unique to one tracked sample, and the subject and cohort fields are accurate. If, for example, S01 had been reused for two unrelated specimens, the distinct-sample count and subject links would not be trustworthy.

Counting Links Precisely

When records are clean, unit counts and links can be stated with simple set notation. Let \(A\) be the set of assay identifiers in the manifest, \(S\) the set of sample identifiers, and \(U\) the set of subject identifiers reached through the sample-to-subject records. The number of assay instances is \(|A|\), the number of distinct samples is \(|S|\), and the number of represented subjects is \(|U|\). These counts need not be equal.

A link from an assay to a subject is established by following the assay-to-sample and sample-to-subject records. It is not established just because two rows have similar names or occur in the same file. This gives a precise way to report what is documented: “five assay instances are recorded, involving four tracked samples from three subjects,” rather than “there are five samples” when five is only the row count.

$$ \text{assay} \longrightarrow \text{sample} \longrightarrow \text{subject} \longrightarrow \text{cohort} $$

This chain is a provenance path, not a claim that every study has exactly one sample per subject or exactly one assay per sample. If a sample is split into aliquots, include the aliquot as a separate tracked unit when the study needs to distinguish those portions. If the records do not distinguish aliquots, state that limitation rather than treating them as identifiable.

Worked Example: Tracing Assay Records to Subjects

In a hypothetical study, the sample manifest states that S10 belongs to subject Q1, S11 belongs to Q1, and S12 belongs to Q2. The assay manifest records B1 on S10, B2 on S11, B3 on S12, and B4 on S12. Assume each sample and assay identifier is unique as defined.

To trace each assay, follow its sample identifier to the sample manifest. B1 maps through S10 to Q1; B2 maps through S11 to Q1; B3 maps through S12 to Q2; and B4 also maps through S12 to Q2. Thus there are \(4\) assay instances, \(3\) distinct samples, and \(2\) distinct subjects represented.

The arithmetic is a count of distinct identifiers: \(|A|=4\), \(|S|=3\), and \(|U|=2\). Q1 is represented by two samples, whereas Q2 is represented by one sample that has two recorded assay instances. The records establish these links; they do not by themselves establish why the samples were collected or whether the assay measurements are biologically comparable.

This conclusion depends on complete, unambiguous sample-to-subject records. If S12 appeared twice with conflicting subject identifiers, B3 and B4 could not be assigned to a unique subject from these records alone. The appropriate conclusion would be that the linkage requires resolution, not that one subject assignment is more likely.

Justifying the Counts and the Limits of a Join

A data merge, or join, is often used to connect assay records to sample and subject records. The join is trustworthy only when the key fields have the intended uniqueness and the relevant links are present. The following short argument explains why the distinct-unit count differs from the row count when multiple records refer to the same unit.

1
Identify the row unit.
In an assay manifest, each row represents an assay instance under the stated convention. Therefore its row count is an assay-record count, not automatically a sample or subject count.
2
Extract the relevant identifiers.
Collect the assay_id values for assay instances, sample_id values for samples, and subject_id values reached through valid links. Count distinct values within each identifier’s defined scope.
3
Check the key conditions.
If each assay_id identifies one assay instance and each sample_id identifies one sample, then distinct identifier counts correspond to unit counts. If an identifier is duplicated for different units, or a link is missing or conflicting, that correspondence fails.

A join can also multiply rows. For example, if a sample identifier occurs twice in the sample manifest, joining one assay record to that key may produce two output rows. The resulting row count is not evidence of two assay instances. The duplicate key must first be investigated: it may reflect a data-entry error, a legitimate one-to-many relationship that needs another identifier, or an incorrectly defined row unit. Counting distinct identifiers can reveal some duplication, but it cannot decide which explanation is correct.

Worked Example: Detecting an Ambiguous Sample Identifier

Consider a hypothetical sample manifest with rows S20–R1 assigned to subject T1 and S20–R2 assigned to subject T2, where the displayed sample_id in both rows is S20. An assay record has assay_id D7 and sample_id S20. Assume the sample identifier is supposed to identify one physical sample.

The assay table contains one assay identifier, so it records one assay instance. However, joining D7 to the two manifest rows yields two possible subject links: T1 and T2. The join has produced two rows, but no new assay instance has been created. Because S20 is not unique under the stated identifier convention, D7 cannot be assigned unambiguously to a subject.

The correction is to consult the provenance records and determine whether the samples should have distinct identifiers, or whether another key such as aliquot_id or collection_event_id is required. Until that is resolved, report one assay instance with an ambiguous subject link. Do not count two subjects for D7 or choose a subject based on row order.

Diagnostics, Comparisons, and Common Mistakes

A useful audit checks whether the stated units and identifiers agree with the records. At minimum, inspect whether assay identifiers are unique, whether every assay points to a recorded sample, whether every sample has a defined subject link when subject-level interpretation is intended, and whether cohort membership is recorded consistently. Also inspect repeated subject and sample identifiers: repetition may be expected across records, but it must match the intended relationship.

There are several reasonable ways to summarize a study, but they answer different questions. An assay-level summary describes measurement events; a sample-level summary describes collected material; a subject-level summary describes represented biological entities; and a cohort-level summary describes the groups under the cohort definition. A report should name its counting unit. “There are 120 records” is incomplete unless readers know what one record represents.

For example, counting rows of an RNA table may give the number of samples represented under that table’s row convention, while counting rows of a manifest may give assay instances. Neither count necessarily equals the number of subjects. The manifest is useful for tracking provenance; the feature table is useful for organizing measurements. Neither replaces the other when the question concerns which subject supplied which assayed material.

  • Counting assay rows as subjects. A subject can contribute multiple samples or assay instances. Count distinct, valid subject identifiers for a subject count.
  • Calling an assay a sample. An assay is a measurement event; a sample is biological material. State explicitly if a data system uses a nonstandard convention.
  • Assuming a cohort from a file label. Cohort membership requires a documented definition and subject-level assignment.
  • Treating a repeated identifier as automatically erroneous. Repeated subject identifiers across samples are expected. Repeated sample identifiers may also be legitimate in some structures, but their meaning must be explicit and consistent with the key definition.
  • Assuming a missing link means no relationship exists. An absent record means the relationship is not established in the available records; it does not prove that the biological material came from a different subject.

These records establish design structure and provenance, not causal effects or measurement quality. Even a perfectly linked manifest cannot show that assays were performed comparably, that an assay measured its intended target accurately, or that the cohort represents a broader population. Those questions require information beyond unit identifiers.

Key takeaway: Report subjects, samples, assays, and cohorts as separate units. Trace relationships through explicit identifiers, count distinct units rather than ambiguous rows, and flag missing or conflicting links instead of guessing.

Check Your Understanding

Answer each question using the unit definitions and record logic from this tutorial. Solutions follow the questions.

  1. An assay manifest has six rows and six distinct assay_id values. Three distinct sample_id values appear, and the linked sample records identify two distinct subjects. How many assay instances, samples, and subjects are represented?
  2. One subject contributes a tissue sample and a blood sample. Each is assayed once. Explain why this is not necessarily two subjects or one sample.
  3. A join from an assay manifest to a sample manifest doubles the number of rows for one assay because the sample_id occurs twice with different subject_id values. What can be concluded about the assay’s subject link?
  4. A file is named “Cohort_A_proteomics,” but the subject registry has no cohort field and the study documentation does not define the label. Is cohort membership established by the file name? Explain.

Solutions. (1) There are \(6\) assay instances, \(3\) distinct samples, and \(2\) represented subjects, assuming the identifiers are valid and the links are complete. (2) There are two samples from one subject; a subject can contribute more than one collected specimen. (3) The assay-to-subject link is ambiguous under the stated key convention. The doubled join rows do not mean there are two assay instances; resolve the sample identifier using provenance records. (4) No. The file name is not sufficient evidence of subject-level cohort membership; a documented cohort definition and assignment are needed.

Clinical Biostats