Why the Subject Must Come First
A multi-omics benchmark can contain several measurement blocks, but its basic sampling unit is usually the biological subject. If RNA, protein, and metabolite measurements are intended to come from the same people, the simulation must select those people once and then assign each block’s measurements to the same subject identities. Generating each block as a separate table and joining them later can silently create false matches or lose the intended pairing.
The central design decision is therefore not only how many features each modality has. It is which subjects are sampled, which modalities are measured on each subject, and how each row in every block maps back to the same subject. The earlier material on Building a Scenario Matrix provides the benchmark scenario; this tutorial turns a matched scenario into a coherent data-generation workflow. It does not prescribe a particular cross-omics correlation structure.
State the Design Before Generating Values
A simulation workflow should make its design assumptions explicit before any measurements are drawn. For a simple complete matched cohort, assume a target population and a defined subject-level sampling rule; each selected subject contributes exactly one row to every modality; the set of measured modalities is the same for every selected subject; and feature dimensions \(p_1,\ldots,p_M\) are fixed by the scenario. If the benchmark assumes independent sampled subjects, subject records are drawn independently under that sampling rule. If it assumes a finite population or a different sampling scheme, the generator must use that scheme instead.
Subject-level attributes, such as a group label or a measured covariate, are also indexed by subject. Let \(z_i\) denote the attributes specified by the scenario for subject \(i\). They must not be sampled separately for each modality when the design says that the modalities come from the same person. The simulation may use those attributes when generating measurements, but their role must be stated rather than left implicit.
A useful distinction is between structural matching and statistical dependence. Structural matching means that row \(i\) in every block belongs to subject \(i\). It does not imply that two features from different blocks are correlated. Conversely, a generator could produce dependent measurements and still fail to preserve matching if it attaches them to incorrect subjects. The subsequent topic on Simulating Cross-Omics Dependence addresses how to specify dependence; here the requirement is to keep the subject-level design intact.
Record the target population, inclusion criteria, sample size \(n\), subject-level strata or labels, and whether the design is complete and matched across modalities.
Create one list of \(n\) unique subjects using the specified sampling and allocation rules. Attach each subject’s attributes to this list.
For each modality \(m\), record \(p_m\) and create a block with \(n\) rows and \(p_m\) feature columns, using the same ordered subject list.
Generate each block according to its stated marginal and signal assumptions, conditional on subject attributes where required. Keep cross-block dependence choices explicit rather than letting separate random-generation calls determine them accidentally.
Check dimensions, unique subject identifiers, row alignment, and consistency of subject attributes across blocks before running a benchmark method.
Dimension and Alignment Checks
For \(M\) modalities in a complete matched cohort, the structural requirement is that every block has exactly \(n\) rows and that its ordered subject identifiers equal the cohort’s subject list. The feature counts may differ across modalities. For instance, a transcriptomic block can have thousands of columns while a protein block has dozens; different \(p_m\) values do not weaken the matching requirement.
Here \(s_i\) is the unique identifier assigned to subject \(i\), and \(\text{rowID}\) is the ordered list of row identifiers. Checking only the row count is insufficient: two blocks may each have \(n\) rows but contain different subjects, duplicates, or different row orders. A reliable implementation stores identifiers explicitly and aligns by identifier, not by the accidental order in which files or arrays happen to be assembled.
Worked Example: Three Complete Blocks
A hypothetical benchmark specifies \(n=120\) subjects, with 800 RNA features, 45 protein features, and 120 metabolite features. Every subject is intended to have all three measurements. Determine the block dimensions and the basic alignment checks.
Let the modality indices be \(m=1,2,3\), with \(p_1=800\), \(p_2=45\), and \(p_3=120\). Applying the dimension rule gives
The total number of feature entries across the three blocks is \(120(800+45+120)=120(965)=115{,}800\). This is a count of entries, not a count of subjects: there are still 120 subjects, each represented in all three blocks.
Suppose the subject identifiers are \(s_1,\ldots,s_{120}\). Each block must contain these 120 identifiers exactly once and in the same order, or be explicitly reordered to that order before joint analysis. The scenario meets the complete matched design only if all three checks hold: the row counts are 120, the feature counts are 800, 45, and 120 respectively, and the identifier sets agree with no duplicates.
Sampling Subjects and Allocating Groups
Subject selection should reproduce the sampling design the benchmark is intended to evaluate. If the scenario calls for simple random sampling from a defined population, draw subjects at that level. If it calls for fixed numbers in specified groups, implement that allocation at the subject level and then carry each selected subject into every modality. Generating a case-control label independently for each block would not represent one matched cohort.
The following example uses fixed group allocation. This is a design choice, not a universal rule: other scenarios may use population proportions or another specified sampling scheme. The important property is that a subject receives one group label, and that same label accompanies the subject’s row across all blocks.
Worked Example: Sampling a Balanced Matched Cohort
A hypothetical study scenario requires 60 cases and 60 controls, each measured in RNA and protein blocks. The feature dimensions are \(p_1=500\) and \(p_2=30\). Show the sampling totals and the resulting block dimensions.
First construct the subject list by selecting 60 case subjects and 60 control subjects according to the scenario’s specified selection rule. The total is \(60+60=120\) distinct subjects. Assign each subject one group label, then use the same 120 identifiers in both blocks.
For each block, the case rows must correspond to the same 60 case identifiers, and the control rows to the same 60 control identifiers. If the blocks are sorted differently, reorder them by subject ID before analysis. The check is not that each block separately contains 60 cases and 60 controls; it is that each subject’s label and identity agree across blocks.
This construction preserves the intended group allocation and matching. It does not establish any particular association between RNA and protein values; that would require an explicit dependence specification.
Why Independent Block Sampling Breaks Matching
A short argument shows why sampling subjects separately for each modality is not a substitute for a matched design. Suppose there are \(n\) distinct subjects and each has a value \(A_i\) in one block and \(B_i\) in another. A matched pair consists of \((A_i,B_i)\). If the second block is instead assigned through an independent random permutation \(\pi\), the constructed pairs are \((A_i,B_{\pi(i)})\), which generally do not refer to the same individuals.
For illustration, assume the values are centered across subjects, so \(\sum_i A_i=\sum_i B_i=0\), and \(\pi\) is a uniformly random permutation independent of the values. Then the expected cross-product under random reassignment is
The equality follows because every \(B_j\) is equally likely to be assigned to each row, so \(E_{\pi}[B_{\pi(i)}]=n^{-1}\sum_j B_j=0\). This does not say that every random reassignment produces a zero cross-product. It shows that random pairing removes the original subject correspondence on average. Any paired analysis or benchmark method that relies on corresponding subjects can therefore be evaluated under the wrong design.
Worked Example: Detecting a Misaligned Block
A hypothetical cohort has four subjects with IDs A, B, C, and D. The RNA block is ordered A, B, C, D. A protein file contains the same four IDs, but in the order C, A, D, B. Is it matched, and what must be done before combining rows?
The ID sets agree and each ID appears once, so the blocks contain the same four subjects. However, row positions do not currently correspond: the first RNA row is subject A while the first protein row is subject C. Combining by row number would create incorrect pairs.
Reorder the protein block to A, B, C, D, matching the RNA block’s identifier order. After reordering, both blocks have \(n=4\) rows with the same row-ID vector. Matching is preserved without changing any measurements; only the row order changes. If an identifier were duplicated or absent, reordering alone would not fix the design—the data-generation or assembly step would need investigation.
Diagnostics, Alternatives, and Limits
Before benchmark methods are run, validate the cohort as data, not merely as a set of matrices. A compact audit should verify that every block has \(n\) rows, the intended feature count \(p_m\), unique IDs, the same subject-ID set, and consistent subject-level attributes. If the design is complete, any absent subject in a block is a generation error rather than a harmless row-count discrepancy. Confirm that the actual sampled group counts match the stated allocation as well.
Common warning signs include matching row counts but differing ID sets, IDs that occur more than once, group labels that disagree across blocks, and one block generated from a fresh subject sample. These failures can make an apparently valid analysis compare unrelated individuals. Also verify that the generator has not silently changed the sample size through filtering or a join that drops unmatched IDs.
| Design choice | What it represents | Main implication |
|---|---|---|
| Matched subject sampling | Each selected subject contributes to every specified block | Preserves subject correspondence for joint or paired analyses |
| Independent modality sampling | Each block is sampled from its own set of subjects | Does not provide within-subject matching, even if row counts agree |
| Matched sampling with row-order differences | The same IDs are present but stored in different orders | Can be aligned by ID; joining by row position is unsafe |
Independent sampling may be appropriate when the benchmark is meant to represent separate cohorts, but it is not an alternative implementation of a matched design. A matched cohort also does not, by itself, reproduce repeated measurements, multiple samples per person, or incomplete modality coverage. Those require additional design specifications. Finally, correct matching cannot compensate for unrealistic marginal distributions, signals, or dependence assumptions; those are separate parts of the simulation scenario.
Common Mistake
The broader lesson is to make the cohort structure auditable. A clear subject list, explicit block dimensions, and reproducible alignment checks make it possible to distinguish a design failure from a method failure when benchmark results are unexpected.
Check Your Understanding
Answer each question using the definitions and workflow above; concise solutions follow.
- A complete cohort has 75 subjects and blocks with 200 RNA and 18 protein features. What are the block dimensions, and how many total feature entries are simulated?
- Two blocks each have 50 rows and 10 features, but their subject-ID sets differ. Are they a matched cohort? Why?
- A scenario requires 24 cases and 36 controls measured in three modalities. What is \(n\), and how should group labels be assigned?
- What does shared subject indexing establish, and what does it not establish about cross-omics values?
Solutions. (1) The dimensions are \(75 \times 200\) and \(75 \times 18\); the total is \(75(200+18)=75(218)=16{,}350\) feature entries. (2) No. Equal row counts do not establish common subjects; the ID sets must agree, with each intended subject represented correctly. (3) \(n=24+36=60\). Assign each of the 60 subjects one case or control label and carry that identity and label into all three blocks. (4) Shared indexing establishes which measurements belong to the same subject. It does not specify whether values in different modalities are statistically dependent or what their dependence structure is.